Jump to content

mitzi

Members
  • Content Count

    64
  • Joined

  • Last visited

Everything posted by mitzi

  1. mitzi

    TCP Client in thread

    Planned service should read data from many TCP clients (connected to various TCP servers), process them and send results to other TCP servers. When I tested this concept in non-thread env I found out that clients first read data from their connections (in main thread) and after all data is read then processed results are sent to servers. It is not parallel. Data reading in main thread blocked sending. There's buffer that receives results from data processing threads and out clients should pop up data from it immediately when they are available and send them out. But this is blocked because main thread is busy due to OnDataAvailable events from reading clients. I need TCP clients to read and send data in threads. Maybe I simply don't use ICS correctly, so please point me correct way.
  2. DFM Editor allows edit and create Borland Delphi VCL/FireMonkey Forms in text and binary format. It is compatible with all Borland/Codegear/Embarcadero development tools (Delphi, Builder, BDS, RAD). DFM Editor can extracts forms from compiled executables and DLLs (or others Portable Executable files) by its extraction tool. Syntax highlihting editor with code folding, object inspector and object tree view are tools that make work easier. There's form preview tool available so you can view form in WYSIWYG mode. DFM Editor allows also user packages (*.bpl) registration to make included components to be known to DFM Editor. For more information see https://www.mitec.cz/dfm.html
  3. What is Project Maker? MiTeC Project Maker is tool for automated batch Delphi projects building. With Project Maker, you can set compiler and its configuration, define actions processed before and after building, patch version information of built binary, sign this binary with specified certificate, apply 3rd-party software protection and many more. How does Project Maker work? Project Maker offers clear powerful interface for project building task definition. Every project can contain unlimited number of tasks. Task represents Delphi project, defined in dpr or dproj file. In addition Project Maker features Profiles, where you can define common properties for project. The project can have unlimited number of profiles. Using profiles you can simply switch between variety of build configurations. Who is Project Maker targeted on? Project Maker is targeted on developers who need to make various build scenarios and make repeated actions automatic. Project Maker is simple but powerful and provides one-click building of very complex and dependent projects. For more information see https://www.mitec.cz/pm.html
  4. New version 2.1.0 released + Delphi 10.4 Sydney compatibility For more information about the library, download locations and documentation, see the MiTeC Weather Forecast Component Home Page
  5. New version 2.0.0 released + Delphi 10.4 Sydney compatibility For more information about the library, download locations and documentation, see the MiTeC Key and Mouse Logger Components Home Page
  6. New version 2.3.0 released + Paquet Builder, WinUPack, PC Guard, Enigma Protector, InstallShield, Delphi 10.4, CAB archive and VMWare Installation Launcher data detection added * Fixed bug in version info reading * Fixed DOS executables detection + Delphi 10.4 Sydney compatibility For more information about the library, download locations and documentation, see the MiTeC Portable Executable Reader Home Page
  7. New version 1.3.0 released + added TIBH_Edge.CheckWebCacheDB and TIBH_IE.CheckWebCacheDB properties + Delphi 10.4 Sydney compatibility For more information about the library, download locations and documentation, see the MiTeC Internet Browser History Component Suite Home Page
  8. New version 14.3.0 released + TSysProcMonThread - Thread description detection (Windows 10+) + TMiTeC_CPU - CPU features detection completely rewritten to be compilant with latest models + Delphi 10.4 Sydney compatibility For more information about the library, download locations and documentation, see the MiTeC System Information Component Suite Home Page
  9. New version 14.1.0 released * TMiTeC_MUS - Fixed available updates detection in 32-bit version + TMiTeC_MUS - Added Update History detection and available updates detection information extended + TMiTeC_MUS - Added Demo 32 * TMiTeC_Storage - Fixed assigning logical drives to physical devices + TSysProcMonThread - Added additional settings properties (PerformanceMeasuring, EvaluateSecurityInfo, RetrieveProcessIcon, RetrieveProcessVersionInfo) For more information about the library, download locations and documentation, see the MiTeC System Information Component Suite Home Page
  10. New version 14.1.0 released + Trusted Platform Module detection added (TMiTeC_Machine.TPM) * Windows Product Key decoding rewritten and fixed + Added Windows available updates detection (MicrosoftUpdateSession)(MSI_MUS.pas, TMiTeC_MUS)  For more information about the library, download locations and documentation, see the MiTeC System Information Component Suite Home Page
  11. New version 14.0.0 released + TProcListMonThread, TSysMonThread, TProcMonThread and TSysModListMonThread merged to new one - TSysProcMonThread (MSI_ProcListMon.pas, MSI_SysMon.pas, MSI.ProcMon.pas, MSI_SysModListMon -> MSI_SysProcMon.pas) + TMiTeC_SysProcMon - CPU usage measuring rewritten and precised - process cpu cycle time is used to usage calculation + TMiTeC_SysProcMon - CPU clock frequency evaluation rewritten - now it is based on real power distribution + TMiTeC_SysProcMon - Handle enumeration rewritten to reflect latest available APIs + TMiTeC_SysProcMon - System process module enumeration added + TMiTeC_SysProcMon - Windows 2000 compatibility fixed + TMiTeC_SysProcMon - Thread start address symbol evaluation + TMiTeC_Security - added product state, component rewritten->new interface + TMiTeC_SMBIOS - Windows 2000 compatibility fixed + TMiTeC_Storage - added SMART data reading for USB disks + TMiTeC_SMBIOS - initial SMBIOS 3.4 compliance + TMiTeC_SMBIOS - Hardware Security table 24 added + TMiTeC_SMBIOS - OEMM strings table 11 added + FPC/Lazarus compatibility  For more information about the library, download locations and documentation, see the MiTeC System Information Component Suite Home Page
  12. ICS v8.63 Hi, Is TSimpleWebSrv able to process POST request with some data (JSON) in body? GET works as expected but POST returns (to Postman) 404 and OnSimpWebSrvReq event is not triggered. Thanks
  13. mitzi

    TSimpleWebSrv and POST

    It's a pitty. It could be perfect for webhook implementation.
  14. ICS v8.63 hi, I have TSslWSocketThrdServer and TSslWSocket. When server is not active (listening) and client tries to connect, following sequence of state changes is triggered: State changed: wsClosed->wsOpened State changed: wsOpened->wsConnecting State changed: wsConnecting->wsConnected State changed: wsConnected->wsClosed Why wsConnected is triggered? It is not true, client cannot be connected even for a while when server is down. It causes big problems when I want to get client reconnected in case of connection lost (or initially not available). I try to connect (in thread) and I get state wsConnected, thread is terminated because connection seems to be established but it is not. Can you fix it? In my opinion it should trigger wsConnecting->wsClosed as a last state change. Thanks.
  15. Of course I did. But when i set TimeoutConnect either to 5 or 5000 OnTimeout event was triggered after 3-4 seconds after Connect was called regardless of TimeoutConnect value. So I'm a little confused.
  16. Thanks, that's it. And timeout is defined in seconds or milliseconds?
  17. hm, i'm trying, but despite the fact I have BUILTIN_TIMEOUT defined, property TimeoutConnect has no effect 😞 What is scale? Seconds or milliseconds?
  18. Well but this is what I ask for. How did you (or others) solve this scenario? Your suggestion is ping. Well, when ping is successful it tells me nothing about my TCP server, if it is running and listening or not. Other suggestion is to abort connection attempt with timer. But it creates new problem with socket reusing. So what? It seems there's no useful advice. I will try to make my own port scan via WinSock.Select with timeout set to 5 secs (as I did in my post above for Delphi Socket component) before TWSocket.Connect. Disadvantage is when server is on, then i will do two connection attempts. First by port scan and second with real client connect. Another one is that this is blocking attempt. 😞 Anyone has better solution?
  19. If client connect attempt to primary server fails, it needs immediately to connect to another one. If socket is in use even after timer 'breaks' connection attempt by Abort, then next immediate attempt will fail too due to socket is in use, won't it?
  20. Your suggestions are no usable. ICMP is security issue and it is no allowed in our environment. Also it only checks IP address accessibility. Not TCP server itself. Other suggestions does not allow the socket to be immediately reused for new connection attempt. Do you really think my request is so stupid?
  21. No I don't have this intent. I found ICS very usable, but this is, in my opinion, key property ICS should have. I just wanted to point that this timeout is possible to be set. You wrote it is not possible by design. It seems it is not true. So my question is whether it is possible to implement this timeout setting to ICS? Consider this situation. I have primary TCP server and backup TCP server. Clients are connected to primary one. If this primary server goes down for any reason, then client loses connection and tries to reconnect. But it can take 20 secs now than it finds server is really inaccessible and then connects to backup server. This reconnection should be as short as possible. Mostly if client is not able to connect within 5 secs server can be considered as inaccessible and then connection to another backup server is processed. But 20 secs is really too long. Your recommendations how to solve this problem when connection timeout cannot be set?
  22. If ICS uses WinSock.Select for connection then timeout can be set via latest parameter. Look at following code sample. I modified method from Delphi System.Win.ScktComp.pas and it does exactly what I want. Sets timeout for connection attempt to 5 secs. Originally it took 20 secs too. But I can't use these components :(. procedure TCustomWinSocket.DoOpen; var v: integer; WrSet : TFDSet; TimeVal : TTimeVal; begin DoSetASyncStyles; Event(Self, seConnecting); v:=1; IOCtlSocket(FSocket,FIONBIO,v); try CheckSocketResult(Winapi.WinSock.connect(FSocket, FAddr, SizeOf(FAddr)),'connect'); TimeVal.tv_sec:=5; TimeVal.tv_usec:=0; FD_ZERO(WrSet); FD_SET(FSocket,WrSet); if Select(0,nil,@WrSet,nil,@TimeVal)<>1 then CheckSocketResult(1,'select'); finally v:=0; IOCtlSocket(FSocket,FIONBIO,v); end; FLookupState := lsIdle; if not (asConnect in FAsyncStyles) then begin FConnected := FSocket <> INVALID_SOCKET; Event(Self, seConnect); end; end; Couldn't be something like this implemented to ICS?
  23. Another question: Is there some timeout for connection attempt? When TWSocket tries to connect to server and server does not exist (non-existing ip address or non-listening server) it takes 20 secs than OnSessionClosed is triggered. Can this timeout be changed/set? Thanks for your support
  24. Is it possible to use TSslWSocketThrdClient descendant instead of TSslWSocket on client side? I tried and it worked except one thing. OnSessionClosed is triggered only once and then never again.
  25. Well. Maybe we dont understand each other. How can I recognize that tcp client is connected to server? On client side? There’s no property except State.
×