zeromq / netmq

A 100% native C# implementation of ZeroMQ for .NET
Other
2.95k stars 744 forks source link

RouterSocket ReceiveReady even does not trigger when dealer SendFramefor #780

Closed generik0 closed 5 years ago

generik0 commented 5 years ago

Thanks for a great package!

Environment

NetMQ Version:    latest
Operating System: Win10
.NET Version:     netstandard + 4.7.2

Expected Behaviour

When using a RouterSocket and accepting messages from multiple dealers, i would like to "register" dealers. Unfortunatley the ReceiveReady even does not trigger for the RouterSocket, but a while true loop with ReceiveFrameBytes does function.

Shouldn't the ReceiveReady trigger when the RouterSocket recieves a message?

using (var server = new RouterSocket("tcp://127.0.0.1:5557"))
            {

                server.ReceiveReady += (s, a) =>
                {
                    var msg = a.Socket.ReceiveFrameString();
                    Console.WriteLine("[Router] - {0}", msg);
                };
                 }
            }

Actual behaviour

Does not trigger.

Steps to reproduce the behaviour

Setup a Dealer/router with a poller, and add ReceiveReady to the router. It is never triggered.

somdoron commented 5 years ago

ReceiveReady only fired when the socket is attached to NetMQPoller.

somdoron commented 5 years ago

https://netmq.readthedocs.io/en/latest/poller/

generik0 commented 5 years ago

@somdoron Ok. So both the Dealer and Router can have a poller, and it will work.?

somdoron commented 5 years ago

Yes

On Wed, Jan 23, 2019, 18:04 Rik Svendsen Rose <notifications@github.com wrote:

@somdoron https://github.com/somdoron Ok. So both the Dealer and Router can have a poller, and it will work.?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zeromq/netmq/issues/780#issuecomment-456859841, or mute the thread https://github.com/notifications/unsubscribe-auth/AClv9iP0UuYWbPhlUPY35iFMjyqcl0Ecks5vGIgqgaJpZM4aOjZM .

generik0 commented 5 years ago

@somdoron it works. Perfect. Thank you. Just a question. The Poller. Is isn't polling anything is it. Is it more a channel listener? Then name is just confusing for me...