This may already work - I'm not familiar with this code yet.
However, when following through the connect path I don't see the socket timeout passed to the native code that actually creates the unix domain socket.
See here -
|
success = NativeUnixSocket.connect(ab, ab.limit(), fd, -2); |
I only see the param used in the context of virtual threads.
The interface supports a connectionTimeout - but it doesn't seem to be respected - just passed down to the AFSocketImpl and then dropped.
Shouldn't it be doing something like: https://github.com/openjdk/jdk/blob/ca52afa38e47bf1c901d05a817fe76d440bff2bd/src/java.base/share/classes/sun/nio/ch/NioSocketImpl.java#L67
I guess it could be because connection hangs are somewhat esoteric and far less likely to occur for UDS. If that's the case, it could be helpful to add a comment on the param explaining what it does - which seems to be something that only applies when using virtual threads.
Apologies if I've missed the way it's actually used.
This may already work - I'm not familiar with this code yet.
However, when following through the connect path I don't see the socket timeout passed to the native code that actually creates the unix domain socket.
See here -
junixsocket/junixsocket-common/src/main/java/org/newsclub/net/unix/AFSocketImpl.java
Line 501 in 75663c0
I only see the param used in the context of virtual threads.
The interface supports a connectionTimeout - but it doesn't seem to be respected - just passed down to the AFSocketImpl and then dropped.
Shouldn't it be doing something like: https://github.com/openjdk/jdk/blob/ca52afa38e47bf1c901d05a817fe76d440bff2bd/src/java.base/share/classes/sun/nio/ch/NioSocketImpl.java#L67
I guess it could be because connection hangs are somewhat esoteric and far less likely to occur for UDS. If that's the case, it could be helpful to add a comment on the param explaining what it does - which seems to be something that only applies when using virtual threads.
Apologies if I've missed the way it's actually used.