I am making a call to Socket.Select on multiple sockets and want the whole thread to block until one (or more) of the sockets are ready. The documentation says that if you give a timeout of -1, the timeout should be infinity. Yet, it returns almost automatically.
I am using .NET 3.5. Here is my code :
Socket.Select(socketAVerifier, null, null, -1);
foreach (var socketsPrets in socketAVerifier)
{
switch (socketsPrets.ProtocolType)
{
case ProtocolType.Tcp:
AccepterConnection();
break;
case ProtocolType.Udp:
EcouterBroadcast();
break;
default:
Journal.WriteLine("Socket de protocol inconnu" +
socketsPrets.ProtocolType,
"Serveur", Niveaux.Grave);
break;
}
}
Is there a way to make the call to Select blocking?
Seemed to be bug in .NET 3.5. Bypassed by passing Int32.MaxInt