예제 #1
0
 private void runSocket()
 {
     while (isRunning)
     {
         try
         {
             datagramQueue.ReadFrom(socket);
         }
         catch
         {
             return;
         }
     }
 }
예제 #2
0
 private void runSocket()
 {
     while (isRunning)
     {
         try
         {
             datagramQueue.ReadFrom(listenSocket);
         }
         catch
         {
             // if we close the socket during a ReceiveFrom, it will throw an exception
             // so handle that exception by returning (and stopping the thread)
             return;
         }
     }
 }
예제 #3
0
 private void runSocket()
 {
     while (true)
     {
         try
         {
             datagramQueue.ReadFrom(internalSocket);
         }
         catch (Exception e)
         {
             if (e is SocketException)
             {
                 var socketException = e as SocketException;
                 if (socketException.SocketErrorCode == SocketError.ConnectionReset)
                 {
                     continue;
                 }
             }
             return;
         }
     }
 }