--
You received this message because you are subscribed to the Google Groups "netmq-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netmq-dev+...@googlegroups.com.
To post to this group, send email to netm...@googlegroups.com.
Visit this group at http://groups.google.com/group/netmq-dev.
For more options, visit https://groups.google.com/d/optout.
you are using the server sockets from two different threads which is not allowed. Once from the main thread to send and one from the Task to receive.
Task.Factory.StartNew(() =>
{
Thread.CurrentThread.Name = "NetMQ - Publish/Subscribe";
using (var server = _Context.CreateXPublisherSocket())
using (var poller = new Poller())
{
server.Options.SendBuffer = ZMQConstants.MegaByte * 100; // 100 megabyte
server.Options.SendHighWatermark = 10000;
server.Options.ReceiveHighWatermark = 10000;
server.Options.Linger = TimeSpan.FromSeconds(5);
server.Bind(Address);
server.ReceiveReady += server_ReceiveReady;
poller.AddSocket(server);
poller.PollTillCancelledNonBlocking();
while (true)
{
var m = MessageQueue.Dequeue();
server.SendMore(m.Key);
server.Send(m.AsBytes);
}
}
});