0
Fork 0
mirror of https://github.com/zeronsh/comet.git synced 2026-11-16 18:57:19 +00:00

Direct links: keep what's open, and don't pair across two LANs numbered alike

Three things kept real direct links from staying up or coming up at all.

A signaling socket ending closed every open connection on that device, and the
room's "gone" closed them on the other side. The room ends every socket every 15
minutes, so a healthy link died on schedule. Signaling only sets connections up:
open ones now stay, unless the coordinator refuses the credentials.

"gone" also reset the pairing pace, so a viewer offered about 20 times a second
to a device whose socket was reconnecting. The pace now stays.

Between two networks both numbered 192.168.1.x, pairing worked about half the
time: checks to the other side's LAN address fail on this device's own link, and
the hole punch failed with them. Plain UDP between the same two networks always
got through, and without those candidates pairing went 12 of 12. A device now
ignores another's private LAN addresses when their public addresses differ.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Wing 2026-11-06 20:36:40 -07:00
commit cee503f5da
2 changed files with 253 additions and 10 deletions