Skip to content

fix(client): improve udp support with probe#1631

Open
gusandrioli wants to merge 2 commits into
TwiN:masterfrom
gusandrioli:udp-support
Open

fix(client): improve udp support with probe#1631
gusandrioli wants to merge 2 commits into
TwiN:masterfrom
gusandrioli:udp-support

Conversation

@gusandrioli
Copy link
Copy Markdown

Summary

Fixes #1536

UDP endpoints with [CONNECTED] == true always reported as healthy, even for closed ports.

net.DialTimeout on UDP always succeeds (UDP is connectionless), so a probe byte is sent after dialing. If the port is closed, the OS returns an ICMP port-unreachable which surfaces as ECONNREFUSED on the subsequent read, marking the connection as failed. A timeout/no-response is treated as success (normal for silent UDP services).

Checklist

  • Tested and/or added tests to validate that the changes work as intended, if applicable.
  • Updated documentation in README.md, if applicable.

Signed-off-by: Gustavo Andrioli <gusaandrioli@gmail.com>
Signed-off-by: Gustavo Andrioli <gusaandrioli@gmail.com>
@gusandrioli gusandrioli changed the title chore: improve udp support with probe fix(client): improve udp support with probe Apr 19, 2026
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.

Successful UDP connection on a closed port

1 participant