ScktComp.SetErrorProc

From RAD Studio VCL Reference
Jump to: navigation, search

Contents

Delphi Information

From ScktComp.pas

	function SetErrorProc(ErrorProc: TSocketErrorProc): TSocketErrorProc;


Unit: ScktComp

Type: function

Visibility: public

C++ Information

From ScktComp.hpp

	void (_fastcall *)(int) __fastcall SetErrorProc(void (_fastcall *)(int) ErrorProc);


Unit: ScktComp

Type: function

Description

Replaces the exception handler for error messages that are received from a Windows socket connection.


Call SetErrorProc to assign an exception handler for error messages from Windows socket API calls. By default, socket components have no special error handler and simply raise an ESocketError exception when they receive error messages. If an exception handler is assigned using SetErrorProc, the socket component does not raise this exception.

The ErrorProc parameter specifies the exception handler. It is passed the Windows socket error code. Inside this exception handler an application can compensate for the error or raise an exception. Passing a value of nil (Delphi) or NULL (C++) for the ErrorProc parameter restores the default behavior, where the socket component raises an ESocketError exception.

SetErrorProc returns the current exception handler. This value is nil (Delphi) or NULL (C++) when SetErrorProc is called for the first time, and is the value of the ErrorProc parameter from the previous invocation of SetErrorProc thereafter.

See Also

Personal tools
Translations
Newest Version