diff --git a/UDPServer/Frm_Server.cs b/UDPServer/Frm_Server.cs index a348054..1100856 100644 --- a/UDPServer/Frm_Server.cs +++ b/UDPServer/Frm_Server.cs @@ -15,7 +15,7 @@ namespace UDPServer public partial class Frm_Server : Form { UdpClient client; - IPEndPoint endpoint; + IPEndPoint endpoint = new IPEndPoint(IPAddress.Any, 0); Dictionary userinfo = new Dictionary(); 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;