Internet Direct (Indy) Version 9.0.2 Beta
SendError
Build and send a UDP error message.

procedure SendError(UDPBase: TIdUDPBase; APeerIP: string; const APort: Integer; const ErrNumber: Word; ErrorString: string);
procedure SendError(UDPClient: TIdUDPClient; const ErrNumber: Word; ErrorString: string);
procedure SendError(UDPBase: TIdUDPBase; APeerIP: string; const APort: Integer; E: Exception);
procedure SendError(UDPClient: TIdUDPClient; E: Exception);
Parameters
UDPBase: TIdUDPBase
UDP client generating the exception.

APeerIP: string
Exception which should be written in the message.

const APort: Integer
UDP descendant generating the exception.

E: Exception
IP address of the peer connection.

Description
SendError is an overloaded method used to construct and send UDP protocol error messages. A UDP error message normally contains the error number and text as specified in ErrNumber and ErrorString.

When the Exception variant is used, the text of the error message will contain Exception.Message.

When the TIdUDPClient variant is used, the Host and Port properties of UDPClient are used to send the error message.