Skip to content

Instantly share code, notes, and snippets.

@somdoron
Last active December 15, 2015 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save somdoron/5175967 to your computer and use it in GitHub Desktop.
Save somdoron/5175967 to your computer and use it in GitHub Desktop.
using (NetMQContext ctx = NetMQContext.Create())
{
using (var server = ctx.CreateResponseSocket())
{
server.Bind("tcp://127.0.0.1:5556");
using (var client = ctx.CreateRequestSocket())
{
client.Connect("tcp://127.0.0.1:5556");
client.Send("Hello");
string m1 = server.ReceiveString();
Console.WriteLine("From Client: {0}", m1);
server.Send("Hi Back");
string m2 = client.ReceiveString();
Console.WriteLine("From Server: {0}", m2);
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment