Exemplo n.º 1
0
        public void SimplePushPull()
        {            
            using (var pullSocket = new PullSocket())
            using (var pushSocket = new PushSocket())
            {
                var port = pullSocket.BindRandomPort("tcp://127.0.0.1");
                pushSocket.Connect("tcp://127.0.0.1:" + port);

                pushSocket.SendFrame("hello");

                Assert.AreEqual("hello", pullSocket.ReceiveFrameString());
            }
        }
Exemplo n.º 2
0
        public void EmptyMessage()
        {            
            using (var pullSocket = new PullSocket())
            using (var pushSocket = new PushSocket())
            {
                var port = pullSocket.BindRandomPort("tcp://127.0.0.1");
                pushSocket.Connect("tcp://127.0.0.1:" + port);

                pushSocket.SendFrame(new byte[300]);

                Assert.AreEqual(300, pullSocket.ReceiveFrameString().Length);
            }
        }