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

MulticastRequest timeout does not put end on QueueWithEnd #41

Open
pwhitey86 opened this issue Jul 20, 2016 · 3 comments
Open

MulticastRequest timeout does not put end on QueueWithEnd #41

pwhitey86 opened this issue Jul 20, 2016 · 3 comments

Comments

@pwhitey86
Copy link

In running:

client_context = yield from aiocoap.Context.create_client_context(loggername='client')
responsesFuture = client_context.multicast_request(message)
responses = []
while (yield from responsesFuture.can_peek()):
  r = responsesFuture.get_nowait()
  print('got future response: %s'%r)
  responses.append(r)
print('while done')

the print('while done') is never reached even after the _timeout() function is reached.

If the queuewithend.py line 822 is changed to

asyncio.async(self.responses.finish())

the end is placed on the queue and the while loop terminates. Is this an issue?

@pauluap
Copy link

pauluap commented Feb 29, 2020

I bumped into the same issue with aiocoap 0.3 and implemented essentially the same workaround.

However, when I look at the code in master, it seems that the multicast request method has been removed. Does that mean that the project is dropping multicast request support?

@chrysn
Copy link
Owner

chrysn commented Feb 29, 2020

Multicast was removed because it didn't actually work -- but if it does for you, I'll have to re-evaluate that.

(The current state of multicast in the 0.4 pre-releases is that it works server-side, but client-side you can only do pseudo-anycast, meaning you send a request to a multicast address, but only receive the first response as "the" response).

I'll have a closer look at this (also to reinstate multicast -- how well does it work for you in 0.3? Do you reliably get all the expected answers?), but can't promise when exactly at the moment.

@pauluap
Copy link

pauluap commented Mar 1, 2020

Thanks for continuing to maintain this project, I appreciate it!

Rather than what the OP did, I wrote asyncio.get_running_loop().run_until_complete(self.responses.finish()) but that amounts to the same thing. Doing that does get things going for me.

I'm not sure what you mean by 'reliably' - it's udp multicast after all, but on my small quiet network with a small number of servers, I'm able to see responses from all of my servers every time I make a multicast request.

I'll eventually need DTLS support, so I took a hack at trying to implement multicast support in master. I'll make up a pull request for that soon. I expect that I made a grievous error somewhere so a code review would be appreciated.

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

No branches or pull requests

3 participants