Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selectors dont work with recv_fd #96

Open
ruby690 opened this issue Nov 1, 2021 · 0 comments
Open

selectors dont work with recv_fd #96

ruby690 opened this issue Nov 1, 2021 · 0 comments

Comments

@ruby690
Copy link

ruby690 commented Nov 1, 2021

I want to get an event. nanomsg , nanomsg/nng#786, tells me use recv_fd for other event loop, if you had one, I test like this:

addr = 'tcp://localhost:31310'
self.nng = pynng.Bus0(listen=addr, recv_buffer_size=None)
self.selector = selectors.SelectSelector()
self.selector.register(
    self.nng.recv_fd,
    selectors.EVENT_READ | selectors.EVENT_WRITE)

I send like this:

addr = 'tcp://localhost:31310'
with pynng.Bus0(dial=addr) as s1:
    print('client')
    s1.send_msg(Message(b'hello'))

but the event loop, self.selector.select(1), report nothing. what happend? How can I use my event loop?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant