Blocking Connections

From RAD Studio
Jump to: navigation, search

Go Up to Reading and Writing Over Socket Connections


When the connection is blocking, your socket must initiate reading or writing over the connection. It cannot wait passively for a notification from the socket connection. Use a blocking socket when your end of the connection is in charge of when reading and writing takes place.

  • For server sockets, set the TServerType to stThreadBlocking to form a blocking connection.
  • For client sockets, set the TClientType to ctBlocking to form a blocking connection.

Depending on what else your client application does, you might want to create a new execution thread for reading or writing, so that your application can continue executing code on other threads while it waits for the reading or writing over the connection to be completed.

See Also