Beispiel #1
0
 ///<summary>Restarts listening on the selected IP address and port.</summary>
 ///<remarks>This method is automatically called when the listening port or the listening IP address are changed.</remarks>
 ///<exception cref="SocketException">There was an error while creating the listening socket.</exception>
 protected void Restart()
 {
     //If we weren't listening, do nothing
     if (ListenSocket == null)
     {
         return;
     }
     ListenSocket.Dispose();
     Start();
 }
Beispiel #2
0
 private void StartListen()
 {
     try
     {
         ListenSocket = CreateListenSocket();
         ListenSocket.Listen(UvConstants.ListenBacklog, ConnectionCallback, this);
     }
     catch
     {
         ListenSocket?.Dispose();
         throw;
     }
 }