Skip to content

Instantly share code, notes, and snippets.

@keithbloom
Created August 19, 2012 12:08
Show Gist options
  • Save keithbloom/3394540 to your computer and use it in GitHub Desktop.
Save keithbloom/3394540 to your computer and use it in GitHub Desktop.
0MQ : Introduction
using (var context = new Context(1))
using (var client = context.Socket(SocketType.REQ))
{
client.Connect("tcp://localhost:5555");
var time = client.Send("", Encoding.Unicode);
Console.WriteLine(time);
}
using (var context = new Context(1))
using (var timeServer = context.Socket(SocketType.REP))
{
timeServer.Bind("tcp://*:5555");
while(true)
{
timeServer.Send(DateTime.Now.ToLongDateString(), Encoding.Unicode);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment