System.Win.ScktComp.TAbstractSocket.Error

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Error(Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;  var ErrorCode: Integer); virtual; abstract;

C++

virtual void __fastcall Error(TCustomWinSocket* Socket, TErrorEvent ErrorEvent, int &ErrorCode) = 0 ;

Properties

Type Visibility Source Unit Parent
procedure
function
protected
System.Win.ScktComp.pas
System.Win.ScktComp.hpp
System.Win.ScktComp TAbstractSocket

Description

Provides the prototype of a method that responds to error conditions.

Descendants of TAbstractSocket must override the abstract or, in C++ terminology, pure virtual Error method to provide a response when socket errors occur. Applications cannot call Error. The Windows socket object that encounters the error condition calls Error automatically.

The Socket parameter indicates the Windows socket object that encounters the error condition.

The ErrorEvent parameter indicates what the socket was trying to do when the error occurred. It has one of the following values:



Value Meaning

eeGeneral

The socket received an error message that does not fit into any of the following categories.

eeSend

An error occurred when trying to write to the socket connection.

eeReceive

An error occurred when trying to read from the socket connection.

eeConnect

For client sockets, this indicates that the client socket can't locate the server, or that a problem on the server prevents the opening of a connection. For server sockets, this indicates that a client connection request that has already been accepted could not be completed.

eeDisconnect

An error occurred when trying to close a connection.

eeAccept

For server sockets only, this indicates that a problem occurred when trying to accept a client connection request.



The ErrorCode parameter is the error code received by the Windows socket object. Setting this value to 0 in the Error method prevents the socket from raising an exception. For information on possible error codes, see the Microsoft documentation on Windows sockets.

See Also