RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
ScktComp.SetErrorProc Function

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

Pascal
function SetErrorProc(ErrorProc: TSocketErrorProc): TSocketErrorProc;
C++
TSocketErrorProc SetErrorProc(TSocketErrorProc ErrorProc);

ScktComp

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. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!