Reputation: 3
I have used Indy most of the time in past but decided to modify the existing project and use synapse instead of Indy. Although, i do have a small question to ask i.e. we all know whenever we create the socket object in Indy it runs on it's own thread, it does all IO operations on the thread it created and doesn't get free or shut down till the object is freed i think.
So pretty much i want to mimic this on synapse.
tl;dr:
How to create a Ttcpblocksocket
object in such a way that it runs all its IO operations on a thread which doesn't get terminated until the object is free ?
Upvotes: 0
Views: 1783
Reputation: 36664
Both libraries do not create a thread to manage client-side socket operations. This allows to create and use them on the application main thread - for example in a VCL event handler which runs a HTTP request - or to move them to a thread (for example to wait in the background for messages sent from the server to the client).
There is the TIdTCPServer component in Indy which creates threads to process incoming data concurrently, but there is no TCP multi-threaded server component in the Synapse library AFAIK.
tl;dr
There is no significant difference between the Indy and Synapse TCP client components regarding their usage with threads.
Upvotes: 1