服务器直接初始化所有数据监听...

master
j502647092 2015-08-05 19:13:39 +08:00
parent b1150377fc
commit e83960ff89
1 changed files with 1 additions and 2 deletions

View File

@ -15,7 +15,7 @@ namespace UDPServer
public partial class Frm_Server : Form
{
UdpClient client;
IPEndPoint endpoint;
IPEndPoint endpoint = new IPEndPoint(IPAddress.Any, 0);
Dictionary<string, IPEndPoint> userinfo = new Dictionary<string, IPEndPoint>();
public Frm_Server()
{
@ -25,7 +25,6 @@ namespace UDPServer
private void Frm_Server_Load(object sender, EventArgs e)
{
client = new UdpClient(new IPEndPoint(IPAddress.Any, 25433));
endpoint = new IPEndPoint(IPAddress.Any, 0);
//启动客户端监听
Thread t = new Thread(new ThreadStart(ClientThread));
t.IsBackground = true;