示例#1
0
        /// <summary>
        /// Creates an IonTcpConnection instance for a given socket and assigns it an unique ID.
        /// </summary>  
        /// <param name="Socket">The System.Networking.Socket.Sockets object to base the Connection on.</param>
        /// <returns>IonTcpConnection</returns>
        public IonTcpConnection CreateConnection(Socket Socket)
        {
            if (Socket == null)
                return null;

            IonTcpConnection Connection = new IonTcpConnection(++mConnectionCounter, Socket);
            CoreManager.GetCore().GetStandardOut().PrintNotice(string.Format("Created Connection for {0}.", Connection.GetIPAddressString()));

            return Connection;
        }
示例#2
0
        /// <summary>
        ///   Creates an IonTcpConnection instance for a given socket and assigns it an unique ID.
        /// </summary>
        /// <param name = "socket">The System.Networking.Socket.Sockets object to base the Connection on.</param>
        /// <returns>IonTcpConnection</returns>
        public IonTcpConnection CreateConnection(Socket socket)
        {
            if (socket == null)
                return null;

            IonTcpConnection connection = new IonTcpConnection(++Count, socket);
            CoreManager.ServerCore.GetStandardOut().PrintNotice(string.Format("Created Connection for {0}.",
                                                                              connection.GetIPAddressString()));

            return connection;
        }
示例#3
0
        /// <summary>
        ///   Creates an IonTcpConnection instance for a given socket and assigns it an unique ID.
        /// </summary>
        /// <param name = "socket">The System.Networking.Socket.Sockets object to base the Connection on.</param>
        /// <returns>IonTcpConnection</returns>
        public IonTcpConnection CreateConnection(Socket socket)
        {
            if (socket == null)
            {
                return(null);
            }

            IonTcpConnection connection = new IonTcpConnection(++Count, socket);

            CoreManager.ServerCore.GetStandardOut().PrintNotice(string.Format("Created Connection for {0}.",
                                                                              connection.GetIPAddressString()));

            return(connection);
        }
示例#4
0
        public void DropConnection(uint clientID)
        {
            IonTcpConnection connection = GetConnection(clientID);

            if (connection == null)
            {
                return;
            }
            CoreManager.ServerCore.GetStandardOut().PrintNotice("Dropped Connection => " +
                                                                connection.GetIPAddressString());

            connection.Stop();
            lock (_connections)
                _connections.Remove(clientID);
        }