System.Win.ScktComp.TServerWinSocket.OnClientError
Delphi
property OnClientError: TSocketErrorEvent read FOnClientError write FOnClientError;
C++
__property TSocketErrorEvent OnClientError = {read=FOnClientError, write=FOnClientError};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
event | public | System.Win.ScktComp.pas System.Win.ScktComp.hpp |
System.Win.ScktComp | TServerWinSocket |
Description
Occurs when a failure is encountered when establishing, using, or terminating the socket connection to an individual client socket.
Write an OnClientError event handler to respond to errors that arise with the connection to a client socket. Set the ErrorCode parameter to 0 if the OnClientError event handler successfully deals with the error condition, to prevent an ESocketError from being raised.
The Sender parameter is the TServerWinClient object that received the client request. The Socket parameter is the TServerClientWinSocket object that manages the connection to the client. The ErrorEvent parameter indicates what Socket was attempting to do when the error occurred. The ErrorCode parameter is the error code returned by the Windows socket API call.
Note: If ServerType is stThreadBlocking, make sure that all code in an OnClientError event handler is thread-safe. Use the GetClientThread method to access thread-specific information.
Note: The OnClientError event handler for TServerWinSocket is also set when setting the OnClientError event handler of the associated TServerSocket.