[Mono-list] Fail to set socket send&receive timeout!
lis1306 at 21cn.com
Mon Dec 19 05:47:48 EST 2005
With your advice I update my redhat9 to fedral4(kernel 2.6.11), but the socket still can't be set timeout property. What is wrong with it? And I also have a problem with Process.GetProcesses(), it can't get all processes in current machine.
Would you do me a favor to help me again please? Thank you very much!
Here is the source code:
static void Main(string args)
//it can't work in fedral core 4(kernel 2.6.11),but works well in winXP
Socket TCPSocket=new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);
//following 2 functions cause a exception:non-block socket would block
IPEndPoint SensorServer=new IPEndPoint(ConnIP,6000);
Console.WriteLine("CommServ is listening...");
Socket AcceptSocket=TCPSocket.Accept();//throw a exception:non-block socket would block
Console.WriteLine("CommClient is accepted...");
byte RcvBuf=new byte;
Process Ps=Process.GetProcesses();//It dosen't work, only get itself
foreach(Process p in Ps)
Console.WriteLine(p.ProcessName);//only output itself, not all processes in current machine,Why?
More information about the Mono-list