コード例 #1
0
 public void PushPullText()
 {
     using (var push = new MessagePusher("localhost", 9101))
     {
         push.Send(Encoding.UTF8.GetBytes("hello"));
         Thread.Sleep(500);
         Assert.Equal("hello", Encoding.UTF8.GetString(_fixture.GetBytes()));
     }
 }
コード例 #2
0
 public void PushPullBytes()
 {
     using (var push = new MessagePusher("localhost", 9101))
     {
         push.Send(new byte[100]);
         Thread.Sleep(500);
         Assert.Equal(100, _fixture.GetBytes().Length);
     }
 }
コード例 #3
0
        public void PushPull()
        {
            var pull = new MessagePuller(9100);

            pull.SetReceiveHandleEvent(new TestPullHandler());
            pull.Listen();

            var Push = new MessagePusher("localhost", 9100);

            pull.Close();
            Push.Close();
        }