User user = new User(newClient);
Thread threadReceive = new Thread(ReceiveData);
threadReceive.Start(user);
userList.Add(user);
AddItemToListBox(string.Format("[{0}]进入", newClient.Client.RemoteEndPoint));
AddItemToListBox(string.Format("当前连接用户数:{0}", userList.Count));
}
}
///
/// 处理接收的客户端数据
///
/// 客户端信息
private void ReceiveData(object userState)
{
}
----------------------------------------------------------------
为什么创建线程的构造方法可以直接方法名了?不是应该是这几个构造方法吗?
System.Threading.Thread.Thread(System.Threading.ParameterizedThreadStart)
System.Threading.Thread.Thread(System.Threading.ParameterizedThreadStart, int)
System.Threading.Thread.Thread(System.Threading.ThreadStart)
System.Threading.Thread.Thread(System.Threading.ThreadStart, int)