示例#1
0
        public ConnectionTester()
        {
            var serverEndpoint = new IPEndPoint(IPAddress.Loopback, 12000);

            using var server = new SocketServer(serverEndpoint);

            var connected = SocketMessenger.CreateAndConnect(serverEndpoint);

            a = server.Accept().Result.Value;

            b = connected.Result;
        }
示例#2
0
        public ProtectionTester()
        {
            var serverEndpoint = new IPEndPoint(IPAddress.Loopback, 12000);

            using var server = new SocketServer(serverEndpoint);

            var connected = SocketMessenger.CreateAndConnect(serverEndpoint);

            var socket1 = server.Accept().Result.Value;
            var socket2 = connected.Result;

            var a = Protector.Protect(socket1, false);
            var b = Protector.Protect(socket2, true);

            protected1 = a.Result;
            protected2 = b.Result;
        }