Inheritance: IDescriptorContainer, IDisposable
        /// <summary>
        /// Initializes a new instance of the <see cref="EncryptedNetworkSession"/> class with no specified socket.
        /// </summary>
        /// <remarks>
        /// Call <see cref="AttachSocket(Socket)"/> before starting the network operations.
        /// </remarks>
        protected EncryptedNetworkSession()
        {
            this.packetBuffer = new BoundedBuffer();
            this.headerBuffer = new BoundedBuffer(4);

            this.baseSession = this.CreateInnerSession();

            this.isDisposed = false;
        }
 private NetworkSession CreateInnerSession()
 {
     var s = new NetworkSession();
     s.DataArrived += this.OnDataArrived;
     s.Closing += this.OnClosing;
     s.SocketError += this.OnSocketError;
     return s;
 }