Skip to content

diode-send stops working after a single error on UDP send #41

Description

@relouman

Hi! 'm working with lidi v2.1.1
On my platform I sometime get an error ECONNREFUSED when the udp.send is called (udp.rs)
Here are the logs of diode-send

Wed, 11 Mar 2026 09:08:09 +0000 [ERROR] fatal udp error: I/O error: libc::sendmsg failed -1 != 1252
Wed, 11 Mar 2026 09:08:12 +0000 [INFO ] (client_0) client c: connected
Wed, 11 Mar 2026 09:08:13 +0000 [INFO ] (client_0) client c: disconnect, 26323 bytes sent
Wed, 11 Mar 2026 09:08:18 +0000 [INFO ] (client_1) client d: connected
Wed, 11 Mar 2026 09:08:19 +0000 [INFO ] (client_1) client d: disconnect, 26323 bytes sent
Wed, 11 Mar 2026 09:08:24 +0000 [INFO ] (client_0) client e: connected
Wed, 11 Mar 2026 09:08:25 +0000 [INFO ] (client_0) client e: disconnect, 26321 bytes sent
Wed, 11 Mar 2026 09:08:31 +0000 [INFO ] (client_1) client f: connected
Wed, 11 Mar 2026 09:08:37 +0000 [INFO ] (client_0) client 10: connected

You can see, the error message, some connected/disconnect then connected and nothing else .
The diode-send is still running but will never work anymore.

When I inspect the code i seed the code
udp.send(packets)?, (twice)

it seems that the error raise an exception that breaks the loop and kills the send thread
the problem is that other threads are still running (ordering/connecting...) and the diode-sender will still run but will never work anymore....

Would it be possible to replace the exception on the udp.send by just logging a warning message?
//replace udp.send(packets)?; //by something like that if let Err(e) = udp.send(packets) { log::warn!("UDP send error (ignored): {e}"); }

Or would it be possible to implement a retry function if an error occurs.

Thank you for your reply

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions