Internet Direct (Indy)
Home
PreviousUpNext
TIdUDPClient.Connect Method

Initializes the client for sending and receiving datagrams.

Pascal
procedure Connect; virtual;

Connect is a method used to initialize the UDP client for sending and receiving datagrams using the UDP protocol. While UDP is a connection-less protocol, the Connect method provides access to the proxy server connection and maintains semantic compatibility with method names in the TCP clients. 

Connect causes an existing socket handle and tranparent proxy connection for the client to be closed when the socket handle in Binding has already been allocated. 

When the TransparentProxy property has been assigned for the client, it is enabled and associated with the Binding for the remote Host and Port number. 

When the TransparentProxy property has not been assigned, additional actions are taken to ensure that a valid socket handle is created and bound for the UDP client. These actions include resolving a host name in the Host property to an IP address, signalling the OnStatus event handler to reflect the host resolution, and binding the socket handle to the IP and Port number required to reach the remote host. 

The OnStatus and OnConnected event handlers are signalled (in that order) to indicate that the socket handle is bound to the remote host. 

Use Connected to determine if a valid socket handle has been allocated for the UDP client. 

Use Disconnect to close the socket handle and the TransparentProxy connection for the UDP client.

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.