设置socket.Receive()的等待时延
socket编程设置socket.Receive()的等待时间:
IPEndPoint remohost=new IPEndPoint(IPAddress.Parse("192.168.0.125"),5010);
Socket s=new Socket(AddressFamily.InterNetwork,SocketType.Dgram,ProtocolType.Udp);
s.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.SendTimeout,time_out);
s.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.ReceiveTimeout,time_out);
……
明白?
-----------------------------------------------------------------