improve udp driver based on other driver receiver thread implementati…#592
improve udp driver based on other driver receiver thread implementati…#592llanesc wants to merge 2 commits intobitcraze:masterfrom
Conversation
ataffanel
left a comment
There was a problem hiding this comment.
Looks great. I have a couple of small comment, the most important being that this changes the protocol so we should make sure it is documented.
| try: | ||
| s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | ||
| s.settimeout(_SCAN_TIMEOUT) | ||
| s.connect(('0.0.0.0', port)) |
There was a problem hiding this comment.
If we always mean to scan on localhost this should be '127.0.0.1'. As far as I know, '0.0.0.0' is not guaranteed to reach localhost (even though is usually do).
There was a problem hiding this comment.
Okay sounds good I can change that. Does 127.0.0.1 work if a user is trying to connect cflib to a server on another machine on the same network? I think i've encountered some users that tried to run cfclient on a seperate machine as crazysim. At the time I was using a modified cfclient that allowed ip address entries so they specified the address themselves. I was wondering if there's a way to do that with the scanning feature I have now.
|
@ataffanel Do you think I should also add an out_queue? Or is that particular to the radio hardware limitations? I noticed that if the server is lagging because of a slower than real time firmware simulation some packets are lost. This might benefit from the "safe_link" method implemented in the radio. |
…entation with changelogs.
Pull request for #590
I have been using this modified udpdriver for CrazySim. The old one was a bit outdated. It basically just includes the receiver thread and has similar features to the other drivers. It also includes a scan feature that scans if a port exists in 19850-19859 for the cfclient.