Zytan
Feb 22nd, 2007, 08:46 AM
The MSDN page for Socket.Connected gives code to show how to properly determine if the socket is connected at the current time, and not just as of the most recent operation, which contains the following code:
http://msdn2.microsoft.com/en-us/lib...connected.aspx
client.Blocking = False
client.Send(tmp, 0, 0)
Console.WriteLine("Connected!")
The above code sets blocking to false, which means you want execution to continue even though the requested operation is not complete. So, if execution continues after Socket.Send, then wouldn't the Console.WriteLine line ALWAYS write "Connected"?
http://msdn2.microsoft.com/en-us/lib...connected.aspx
client.Blocking = False
client.Send(tmp, 0, 0)
Console.WriteLine("Connected!")
The above code sets blocking to false, which means you want execution to continue even though the requested operation is not complete. So, if execution continues after Socket.Send, then wouldn't the Console.WriteLine line ALWAYS write "Connected"?