Skip to content

improve udp driver based on other driver receiver thread implementati…#592

Open
llanesc wants to merge 2 commits intobitcraze:masterfrom
llanesc:dev-udpdriver
Open

improve udp driver based on other driver receiver thread implementati…#592
llanesc wants to merge 2 commits intobitcraze:masterfrom
llanesc:dev-udpdriver

Conversation

@llanesc
Copy link

@llanesc llanesc commented Feb 14, 2026

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.

@ataffanel ataffanel self-requested a review February 16, 2026 10:38
Copy link
Member

@ataffanel ataffanel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@llanesc
Copy link
Author

llanesc commented Feb 16, 2026

@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.

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

Successfully merging this pull request may close these issues.

2 participants

Comments