Jump to content

chmichael

Members
  • Content Count

    52
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by chmichael

  1. Hello, How can i check if a TCP port is open over Internet with timeout using ICS ? Thank you
  2. chmichael

    TCP Port Check with timeout

    Got it! Thanks!
  3. chmichael

    TCP Port Check with timeout

    Ok, i fixed the routine to work both on main and on a thread. It works correctly locally but remotely it always connect OK even if the "server/port" is closed. Any ideas ? btw, doSocketRemoteClick has the same behavior. function IsInternetPortOpenICS(const AIPAddress: AnsiString = ''; const APort: Word = 0; const ATimeOut: NativeUInt = INFINITE): Boolean; var IpLogClient: TIcsIpStrmLog; FThreadID, FTimeout: NativeUInt; begin Result := False; try FThreadID := GetCurrentThreadId; IpLogClient := TIcsIpStrmLog.Create(nil); IpLogClient.LogProtocol := logprotTcpClient; IpLogClient.RemoteHost := AIPAddress; IpLogClient.RemoteIpPort := APort.ToString; //IpLogClient.onLogProgEvent := Form9.onCliLogProgEvent; //IpLogClient.CheckPing := True; //IpLogClient.PingWaitSecs := 1; if FThreadID <> MainThreadID then IpLogClient.MultiThreaded := True; IpLogClient.StartLogging; FTimeout := 0; while FTimeout < ATimeout do begin if FThreadID = MainThreadID then Application.ProcessMessages else IpLogClient.ProcessMessages; Result := IpLogClient.States[0] = logstateOK; if Application.Terminated or Result then Break; Inc(FTimeout, 10); Sleep(10); end; IpLogClient.StopLogging; finally if Assigned(IpLogClient) and IpLogClient.AnyStateOK then IpLogClient.StopLogging; FreeAndNil(IpLogClient); end; end;
  4. chmichael

    TCP Port Check with timeout

    Hello Angus, How can i get the result ? (Is open or not) Do i have to use application.processmessages ? I'm going to use this routine in a thread. Thank you function IsInternetPortOpenICS(const AIPAddress: AnsiString = ''; const APort: Word = 0; const ATimeOut: NativeUInt = INFINITE): Boolean; var IpLogClient: TIcsIpStrmLog; begin try IpLogClient := TIcsIpStrmLog.Create(nil); IpLogClient.MaxSockets := 1; IpLogClient.LogProtocol := logprotTcpClient ; IpLogClient.RemoteHost := AIPAddress; IpLogClient.RemoteIpPort := APort.ToString; IpLogClient.CheckPing := False; IpLogClient.StartLogging; Result := // Check if connected ??? IpLogClient.StopLogging; finally if Assigned(IpLogClient) and IpLogClient.AnyStateOK then IpLogClient.StopLogging; FreeAndNil(IpLogClient); end; end;
  5. chmichael

    TCP Port Check with timeout

    Well I'm using the following code to do what you're saying but for some reason it doesn't always work! Eg. even if the server port is closed it will return "True".
  6. chmichael

    Error 1400

    Hello, When i'm closing the application eg, after 30 seconds OTL will raise an exception with error code 1400 invalid window handle. Any ideas ? Thank you Code: var FTask1: IOmniTimedTask; FTask2: IOmniTimedTask; procedure StartTimedTasks(const Task: IOmniTask); begin FTask1 := Parallel.TimedTask.Every(1000).Execute(DoSometing1); FTask2 := Parallel.TimedTask.Every(1000).Execute(DoSometing2); end; procedure TFormApplication.FormShow(Sender: TObject); begin Parallel.Async(StartTimedTasks); end;
  7. chmichael

    ID3D11Texture2D to TBitmap and RowPitch

    Hello, Anyone knows how to copy the Bits from a ID3D11Texture2D which it has different RowPitch than Bitmap.Width * 4 ? if FTexture.RowPitch = FBitmap.Width * 4 then for I := 0 to FBitmap.Height - 1 do Move(FTexture.pData[4 * FBitmap.Width * I], FBitmap.Scanline^, 4 * FBitmap.Width); else ????? Thank you
  8. chmichael

    ID3D11Texture2D to TBitmap and RowPitch

    I have checked that but it doesn't check the RowPitch.
  9. chmichael

    Bitmaps2Video for Windows Media Foundation

    For streaming it's always the same
  10. chmichael

    Bitmaps2Video for Windows Media Foundation

    Well if you use it for internal use or streaming purposes you don't care.
  11. chmichael

    Bitmaps2Video for Windows Media Foundation

    bme.AddFrame(bm, false); It took 53 milliseconds to encode a 8k image faster than turbo-jpeg and with lower size as you say. Imagine using a TMemoryStream you can do whatever you want with the frames and i'll don't care about the expensive initialization. I don't understand why it creates a 10s video instead of 1s ...
  12. chmichael

    Bitmaps2Video for Windows Media Foundation

    That goes to my first request " 1) Encode to Stream". As far the compression HEIF actually uses H.265 compression but there is not any hardware acceleration in Delphi or at least haven't found any! https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format HEIF files containing HEVC-encoded images are also known as HEIC files. Such files require less storage space than the equivalent quality JPEG.[2][3] Thank you
  13. chmichael

    Bitmaps2Video for Windows Media Foundation

    I was hoping i could use H264/5 hardware encoder/decoder for a single image. It should be faster and smaller than turbo-jpeg.
  14. chmichael

    Bitmaps2Video for Windows Media Foundation

    Can you add: 1) Encode to Stream 2) Hardware encode only 1 image ? Thank you
  15. chmichael

    Parallel Resampling of (VCL-) Bitmaps

    Just curious, anyone tried Skia for resampling ?
  16. chmichael

    Windows 11 (22H2) 8bit bitmap problem

    Yeap, ReduceColors doesn't have this issue!
  17. chmichael

    Windows 11 (22H2) 8bit bitmap problem

    Did you find any solution ? I have the same problem!
  18. chmichael

    IOCP

    Hello, Any chance for IOCP support in the future ?
  19. chmichael

    IOCP

  20. Hello, There a number of github issues without any fixes. Is this project still alive ? Thank you
  21. Hello, Can somebody implement the Synced functions of WSocket.DnsLookup and also TWDNSQuery ? (with timeout too) Thank you
  22. chmichael

    DNS Query & Lookup Synced

    The question is how to check it without using application.processmessages ?
  23. chmichael

    JSON text validation...

    @Lars FosdalDunno, I didn't post this so i am changing the password to be sure!
  24. chmichael

    JSON text validation...

    https://deleted - visit website and win smartphone!
  25. chmichael

    DNS Query & Lookup Synced

    Thank you both guys!
×