Topic Path: Symbol Reference > Classes > TIdUDPClient Class > TIdUDPClient Methods > Disconnect Method
ContentsIndexHome
PreviousUpNext
TIdUDPClient.Disconnect Method

Closes the socket handle and transparent proxy for the client.

procedure Disconnect; virtual;

Disconnect is a method used to close the socket handle allocated for the UDP client,and ensures that the TransparentProxy for a UDP client is closed as well. 

While UDP is a connection-less protocol, Disconnect allows closing both the socket handle and the optional TransparentProxy used for the UDP client. Disconnect uses the value from the Connected method to determine if a socket handle has been allocated for the client. When a socket handle has been assigned, the OnStatus event handler is signalled to indicate that the UDP client is disconnecting by de-allocating the socket handle in Binding

If a TransparentProxy has also been assigned for the client, it is closed. 

Disconnect signals the OnDisconnected and OnStatus event handlers (in that order) prior to exiting from the method. 

Use Connect ensure that a socket handle is allocated for the client.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.