コード例 #1
0
        public void CheckConnectivity()
        {
            var port = GetFreePort();
            var server = new AsyncRpc.Transport.Tcp.TcpHost(new Handler());
            server.StartListening(new IPEndPoint(IPAddress.Loopback, port));
            var client = new AsyncRpc.Transport.Tcp.TcpClientTransport("127.0.0.1", port);

            var message = new byte[] {1, 2, 3, 4, 5};
            var task = client.SendMessageAsync(message);
            task.Wait();

            Assert.True(task.Result.SequenceEqual(message));
        }
コード例 #2
0
        public void CheckConnectivity()
        {
            var port   = GetFreePort();
            var server = new AsyncRpc.Transport.Tcp.TcpHost(new Handler());

            server.StartListening(new IPEndPoint(IPAddress.Loopback, port));
            var client = new AsyncRpc.Transport.Tcp.TcpClientTransport("127.0.0.1", port);

            var message = new byte[] { 1, 2, 3, 4, 5 };
            var task    = client.SendMessageAsync(message);

            task.Wait();

            Assert.True(task.Result.SequenceEqual(message));
        }