Checking for a closed connection

AndreRyan

Well-known member
Joined
Jan 23, 2002
Messages
366
Ive got a TcpClient class and I used the System.Type system to forge a connection to the Socket property, Im using the Poll command but SelectMode.SelectRead returns True on data arrival as well so is there another way to check or can you filter out to see if its a data arrival or the connections closed.
 
I figured it out:
Code:
If sock.Poll(10000, SelectMode.SelectRead) = True AndAlso sock.Avaliable = 0 Then
If there is 0 Avaliable data then its a "Cconnection close" notification
 
Back
Top