Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listen on multiple sockets when needed #563

Merged
merged 1 commit into from Jul 12, 2021
Merged

Conversation

tleedjarv
Copy link
Contributor

See #562 for background.

This is the first attempt at it, and may be sufficient. Listen and accept on multiple sockets if multiple addresses are returned by getaddrinfo.
There are some indentation changes, diff -w may help when reviewing.

Fixes #562

Previous code assumed there is always only one listening socket. That
one socket happened to be the first one that was successfully created
and bound. Usually, that would be IPv4 but it could just as well have
been IPv6.

This patch enables creating multiple listening sockets (for vast
majority of cases it is expected to be 2) and accepting clients on all
of these sockets. Like before, a single client at a time is served.
@gdt
Copy link
Collaborator

gdt commented Jul 6, 2021

As usual, I would really love to see a code review or test report (from other than the submitter, who I am confident has tested). But will time out on that and merge anyway after a while if not.

@gdt gdt merged commit e26181a into bcpierce00:master Jul 12, 2021
@tleedjarv tleedjarv deleted the socket-ipv6 branch July 15, 2021 11:14
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.

"unison -socket N" listens only on IPv6
2 participants