B
Boris
I have a strange problem as Socket.Select() doesn't block when I call it in
C#. To be sure that there is no error in my code I went to
http://msdn.microsoft.com/library/d...lrfsystemnetsocketssocketclassselecttopic.asp
and copied the sample C# code into VS 2004. When I run the sample code
Socket.Select() does not block?! It returns immediately with an empty IList.
Can anyone please compile and run the following code? I don't understand why
Socket.Select() does not block on my machine? Is Socket.Select() broken or
my .NET framework?
----------------------------
using System;
using System.Collections;
using System.Net;
using System.Net.Sockets;
class SelectTest
{
static void Main(string[] args)
{
Socket mySocket = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
mySocket.Bind(new IPEndPoint(IPAddress.Any, 12345));
mySocket.Listen(1);
ArrayList list = new ArrayList();
list.Add(mySocket);
Socket.Select(list, null, null, 1000000);
}
}
C#. To be sure that there is no error in my code I went to
http://msdn.microsoft.com/library/d...lrfsystemnetsocketssocketclassselecttopic.asp
and copied the sample C# code into VS 2004. When I run the sample code
Socket.Select() does not block?! It returns immediately with an empty IList.
Can anyone please compile and run the following code? I don't understand why
Socket.Select() does not block on my machine? Is Socket.Select() broken or
my .NET framework?
----------------------------
using System;
using System.Collections;
using System.Net;
using System.Net.Sockets;
class SelectTest
{
static void Main(string[] args)
{
Socket mySocket = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
mySocket.Bind(new IPEndPoint(IPAddress.Any, 12345));
mySocket.Listen(1);
ArrayList list = new ArrayList();
list.Add(mySocket);
Socket.Select(list, null, null, 1000000);
}
}