private void accept()
{
while (true)
{
Socket createSocket = socketWith.Accept();
dicSoc.Add(createSocket.RemoteEndPoint.ToString(), createSocket);
libRemote.Items.Add(createSocket.RemoteEndPoint.ToString());
Thread sendThread = new Thread(send);
sendThread.SetApartmentState(ApartmentState.STA); //解决另存为对话框不出现的问题
sendThread.IsBackground = true;
sendThread.Start(createSocket);
displayMes("已连接成功!");
}
}
|