日期:2014-05-18  浏览次数:20905 次

C# List列表中添加 socket
如何将 Socket c1,c2,c3,c4 放到
 List<Socket> port = new List<Socket> 
  {
   
  };


------解决方案--------------------
C# code
Socket c1 = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Socket c2 = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Socket c3 = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Socket c4 = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
List<Socket> c = new List<Socket> { c1, c2, c3, c4 };