private void Listen() { try { while (true) { Socket socket = listener.AcceptSocket(); try { ITransport transport = new TcpTransport(socket); Core.LoggingService.LogInfo("New incoming transport: {0}.", transport.ToString()); Core.TransportManager.Add(transport); // TransportManager will take care of this // connection now } catch (Exception ex) { Core.LoggingService.LogError(ex.ToString()); } } } catch (ThreadAbortException) { // Someone called StopListening(), that's OK... } catch (Exception ex) { Core.LoggingService.LogError("Error in TcpListener.Listen()", ex); } }
private void Listen() { try { while (true) { Socket socket = listener.AcceptSocket(); try { ITransport transport = new TcpTransport(socket); LoggingService.LogInfo("New incoming transport: {0}.", transport.ToString()); Core.TransportManager.Add(transport); // TransportManager will take care of this // connection now } catch (Exception ex) { LoggingService.LogError(ex.ToString()); } } } catch (ThreadAbortException) { // Someone called StopListening(), that's OK... } catch (Exception ex) { LoggingService.LogError("Error in TcpListener.Listen()", ex); } }