예제 #1
0
        public Connection(int index, TcpClient client)
        {
            Index       = index;
            this.client = client;
            buffer      = new byte[ushort.MaxValue + 1];

            var address = client.Client.RemoteEndPoint.ToString();

            IpAddress = new IpAddress(address, 0);

            RSAKey = new ConnectionKey();
            msg    = new ByteBuffer();

            Connected = client.Connected;

            AesKey = new AesKey();

            var generator = new KeyGenerator();

            UniqueKey = generator.GetUniqueKey();
            AesKey.CreateKey(generator.GetUniqueKey());
        }