C#聊天程序(13) listener.Listen(0); socket = listener.Accept(); listener.Close(); }catch(SocketException e){ // If there is already a listener on this port try client if(e.ErrorCode == 10048){ client = true; endPoint = new IPEndPoint( Dns.Resolve("127.0.0.1").AddressList[0], endPoint.Port); }else{ Notifications( Notification.Error,