G
Guest
I am not sure if this is a bug or not but it seems strange to me. If I set
the tcp socket blocking to false and do a connect, then I can catch the
socketexception. If the exception is WSAEWOULDBLOCK, then I do a poll with
timeout to see if I can connect to the remote host. When the poll returns
true, the socket Connected property is still false. Why is this?
sock.Blocking = false;
try
{
sock.connect (...)
}
catch (SocketException e)
{
if (10035 == e.ErrorCode) // WOULDBLOCK
{
bool connected = sock.Poll (10000000, Selectmode.SelectWrite);
}
}
When the connected is true but the sock.Connected is still false.
Can I assume when the poll returns true, I can be sure the socket is
connected regardless of the Connected property in socket?
Thanks.
the tcp socket blocking to false and do a connect, then I can catch the
socketexception. If the exception is WSAEWOULDBLOCK, then I do a poll with
timeout to see if I can connect to the remote host. When the poll returns
true, the socket Connected property is still false. Why is this?
sock.Blocking = false;
try
{
sock.connect (...)
}
catch (SocketException e)
{
if (10035 == e.ErrorCode) // WOULDBLOCK
{
bool connected = sock.Poll (10000000, Selectmode.SelectWrite);
}
}
When the connected is true but the sock.Connected is still false.
Can I assume when the poll returns true, I can be sure the socket is
connected regardless of the Connected property in socket?
Thanks.