示例#1
0
        /// <summary>
        /// Creates a new instance of the network incoming buffer relying on the already
        /// connected socket instance. The buffer does not decrypt anything.
        /// </summary>
        /// <param name="listener">The listener who knows the pool.</param>
        /// <param name="socket">The already connected socket.</param>
        /// <param name="identifier">The unique connection identifier.</param>
        public NetworkIncomingBuffer(NetworkPoolListener listener, TcpSocket socket, long identifier)
        {
            this.listener   = listener;
            this.socket     = socket;
            this.identifier = identifier;

            memory = listener.Allocate();
        }
示例#2
0
        /// <summary>
        /// Creates a new instance of the network outgoing buffer relying on the already
        /// connected socket instance. The buffer does not encrypt anything.
        /// </summary>
        /// <param name="listener">The listener who knows the pool.</param>
        /// <param name="socket">The already connected socket.</param>
        /// <param name="identifier">The unique connection identifier.</param>
        public NetworkOutgoingBuffer(NetworkPoolListener listener, TcpSocket socket, long identifier)
        {
            this.listener   = listener;
            this.socket     = socket;
            this.identifier = identifier;

            memory = listener.Allocate();
            parts  = new HashSet <int>();
        }