Advertisement
Guest User

Publisher

a guest
May 23rd, 2011
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using ZMQ;
  5.  
  6. namespace HwmTest
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             Context context = new Context(1);
  13.  
  14.             Socket pubSocket = context.Socket(SocketType.PUB);
  15.             pubSocket.HWM = 10;
  16.             pubSocket.Bind("tcp://*:5555");
  17.  
  18.             int msgId = 0;
  19.  
  20.             while (true)
  21.             {
  22.                 string msg = (++msgId).ToString();
  23.  
  24.                 pubSocket.Send(msg, Encoding.UTF8);
  25.             }
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement