Beispiel #1
0
        public void Destroy()
        {
            this.acceptConnections = false;
            try
            {
                this.nettyServer.StopListening();
            }
            catch
            {

            }
            this.nettyServer = null;
        }
Beispiel #2
0
 public Connection(Socket socket, NettyServer nettyServer)
 {
     _socket      = socket;
     _nettyServer = nettyServer;
 }
Beispiel #3
0
 public Connection(Socket socket, NettyServer nettyServer)
 {
     _socket = socket;
     _nettyServer = nettyServer;
 }
Beispiel #4
0
 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);
     }
 }
Beispiel #5
0
 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);
     }
 }