From RAD Studio API Documentation
Jump to: navigation, search


property ClientType: TClientType read GetClientType write SetClientType;


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


Type Visibility Source Unit Parent
property published
System.Win.ScktComp TClientSocket


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

Set ClientType to ctNonBlocking to enable the client socket to respond to asynchronous reading and writing events. When ClientType is ctNonBlocking, execution is not blocked by reading and writing over the socket connection. OnRead or OnWrite events occur when the socket needs to read or write over the connection.

Set ClientType to ctBlocking to force all reading and writing to occur synchronously. It is a good idea to include the client socket object in a thread if the ClientType is ctBlocking, so that I/O does not block all execution within the client application.

When ClientType is ctBlocking, use a TWinSocketStream object for reading and writing. TWinSocketStream prevents the application from hanging indefinitely if a problem occurs while reading or writing. It also can wait for the socket connection to indicate its readiness for reading.

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

See Also