public void Destroy() { this.acceptConnections = false; try { this.nettyServer.StopListening(); } catch { } this.nettyServer = null; }
public Connection(Socket socket, NettyServer nettyServer) { _socket = socket; _nettyServer = nettyServer; }
public Client(NettyServer.Connection iAr) { try { _connection = iAr; Socket thisSocket = _connection.Socket; IP = thisSocket.RemoteEndPoint.ToString().Split(new char[]{':'})[0]; this.acceptedConnections++; ConnectionInformation connectionInformation = new ConnectionInformation(thisSocket, this.acceptedConnections, this, this.parser, IP); this.reportUserLogin(IP); connectionInformation.connectionChanged += new ConnectionInformation.ConnectionChange(this.CConnectionChanged); if (connectionEvent != null) { connectionEvent(connectionInformation); } } catch (Exception ex) { Console.WriteLine(ex); } }
protected void PrepareConnectionDetails() { IPAddress Ip = IPAddress.Any; string ip = Ip.ToString(); int port = this.portInformation; this.clients = new Dictionary<int, Client>(); this.nettyServer = new NettyServer(true); try { nettyServer.BindSocket(ip, port); } catch (SocketException ex) { throw new SocketInitializationException(ex.Message); } }