Exemple #1
0
        public Connection(Server server, TcpClient tcpClient)
        {
            VerbMap = new VerbMap();
            Session = new Session()
                          {
                              ClientAddress = ((IPEndPoint) tcpClient.Client.RemoteEndPoint).Address,
                              StartDate = DateTime.Now
                          };

            Server = server;
            _tcpClient = tcpClient;
            _tcpClient.ReceiveTimeout = Server.Behaviour.GetReceiveTimeout(this);

            ReaderEncoding =
                new ASCIISevenBitTruncatingEncoding();
            _stream = tcpClient.GetStream();

            SetupReaderAndWriter();
            SetupVerbs();
        }