System.Win.ScktComp.TClientSocket.ClientType

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property ClientType: TClientType read GetClientType write SetClientType;

C++

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

Properties

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

Description

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