Indy 9
TIdMappedPortUDP
Hierarchy, Properties, Methods, Events, See Also, Unit: IdMappedPortUDP
Implements a proxy for UDP connections to a remote computer system.
TIdMappedPortUDP = class(TIdUDPServer)
Unit
IdMappedPortUDP
Description
TIdMappedPortUDP is a TIdUDPServer descendant that implements a proxy for connections to a remote computer system using the UDP protocol. TIdMappedPortUDP listens for connections on a designated host address and port number, and makes a surrogate connection to another server using a specified port number. This is useful for certain types of proxy programs. TIdMappedPortUDP also implements an event notification mechanism for new connection requests.

TIdMappedPortUDP.MappedHost
TIdMappedPortUDP, See Also
Identifies the host name or IP address for remote system.
property MappedHost: string;
Description
MappedHost is a String property that identifies the host name or IP address for the connection to a remote system. MappedHost is used in DoUDPRead when the surrogate UDP connection is created for the current connection request.

TIdMappedPortUDP.OnRequest
TIdMappedPortUDP, See Also
Event handler for request to connect to a remote system.
property OnRequest: TNotifyEvent;
Description
OnRequest is a TNotifyEvent event handler used to respond to connection requests using a surrogate UDP client connection to a remote system. Applications must assign a procedure to the event handler to allow response to the event notification.

OnRequest is triggered in DoUDPRead prior to establishing the surrogate connection to a remote system for the local UDP client.


TIdMappedPortUDP.Create
TIdMappedPortUDP, See Also
Constructor for the object instance.
constructor Create(AOwner: TComponent); override;
Parameters
AOwner: TComponent
Owner of the object instance.
Description
Create is the Constructor for the object instance, and relies on the inherited Create method. Create also assigns the constant value IdPORT_DOMAIN to the DefaultPort property.

TIdMappedPortUDP.DoUDPRead
TIdMappedPortUDP, See Also
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.


Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.