Internet Direct (Indy) Version 9.0.2 Beta
TIdMappedPortUDP.DoUDPRead
Implements transmission of data from a TStream descendant on a surrogate UDP client connection.

procedure DoUDPRead(AData: TStream; ABinding: TIdSocketHandle); override;
Parameters
AData: TStream
Stream containing data to be sent on the connection.

ABinding: TIdSocketHandle
Socket binding generating the request.

Description
DoUDPRead is an overridden procedure in TIdMappedPortUDP that extends the inherited method to allow transmission of data read from a TStream descendant on the surrogate UDP client connection.

DoUDPRead calls the inhertied DoUDPRead method, and generates the OnRequest event notification for the connection. DoUDPRead creates a private TIdUDPClient instance that acts as a surrogate connection to the remote system identified in MappedHost and MappedPort. DoUDPRead attempts to read all of the remaining contents in AData, transmit the data, and read any response from the remote system. If a response is received, the value is send to peer connection in ABinding.