From RAD Studio API Documentation
Jump to: navigation, search


property ClientType: TClientType read FClientType write SetClientType;


__property TClientType ClientType = {read=FClientType, write=SetClientType, nodefault};


Type Visibility Source Unit Parent
property public
System.Win.ScktComp TClientWinSocket


Specifies whether the client Windows socket reads and writes information asynchronously over the socket connection.

Client socket components set ClientType to reflect their own ClientType property. When ClientType is ctNonBlocking, the client Windows socket responds to asynchronous reading and writing events, and execution is not blocked by reading and writing over the connection. OnSocketEvent events occur when the socket needs to read or write over the connection.

When ClientType is ctBlocking, all reading and writing occur synchronously. It is a good idea to perform all reading and writing in a separate thread if ClientType is ctBlocking. Reading and writing in a separate thread ensures that these operations do not block all execution within the client application.

When ClientType is ctBlocking, use a TWinSocketStream object for reading and writing. TWinSocketStream times out so that the application does not hang when a problem occurs while reading or writing. TWinSocketStream also provides a method to wait, before reading, until the socket connection is ready to send information.

Use a non-blocking socket when the socket needs to synchronize reading and writing with server sockets.

See Also