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

EpollAsyncServerSocketChannel#bind(null) should use wildcard, not give NPE #63

Closed
LeeTibbert opened this issue Sep 16, 2022 · 3 comments · Fixed by #97
Closed

EpollAsyncServerSocketChannel#bind(null) should use wildcard, not give NPE #63

LeeTibbert opened this issue Sep 16, 2022 · 3 comments · Fixed by #97
Labels
bug Something isn't working

Comments

@LeeTibbert
Copy link
Collaborator

The Java spec for ServerSocketChannel#bind(null) states that a null argument
should use an address of Java's choice. The JVM appears to use the wildcard
address for the underling implementation socket '0.0.0.0' or "::0" (expanded).
I believe there is a description else where which directs the use of wildcard.

I believe this is architecture and os version independent.

Code in EpollAsyncServerSocketChannel#bind should be relatively
easy to fix.

@armanbilge
Copy link
Owner

Using a wildcard seems reasonable. Note that FS2 will never pass a null value here, but being compliant here is easy.

@armanbilge armanbilge added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Sep 16, 2022
@LeeTibbert
Copy link
Collaborator Author

Using a wildcard seems reasonable. Note that FS2 will never pass a null value here, but being compliant here is easy.

Good to know the context. Thank you

Some weenie writing test code might pass a null ;-) I discovered this by trying to use it
with its JVM described parent AsynchMumble.

In general Scala code I have little patience for people passing null's around. However,
on the edge of Scala & JVM I am forced to be a little more accomodating. I will
put this on the "someday" pile,

LeeTibbert added a commit to LeeTibbert/epollcat_devo that referenced this issue Dec 2, 2022
LeeTibbert added a commit to LeeTibbert/epollcat_devo that referenced this issue Dec 2, 2022
@LeeTibbert
Copy link
Collaborator Author

I note for future reference that the C getaddrinfo specification & practice is to treat
a null nodename as equivalent to localhost.

armanbilge added a commit that referenced this issue Dec 2, 2022
Fix #63: Server bind(null) becomes JVM bind(wildcard)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants