OnDisconnect Event  
 

The OnDisconnect event is generated when a client connection is terminated.

Syntax

Sub object_OnDisconnect ( [Index As Integer,] ByVal Handle As Variant )

Remarks

The OnDisconnect event is generated when the connection is terminated by the client and there is no more data available to be read. The Handle argument specifies the socket handle of the client session which has terminated. It is important to note that the client handle is provided for informational purposes only and the application should not attempt to read or write data using this handle. When this event fires, the connection to the client has already been closed and the handle is no longer valid.

It is not necessary to call the Disconnect method inside the OnDisconnect event handler because the connection has already been closed.

See Also

OnConnect Event