Didier Villevalois
09/06/2021, 3:34 PMAF_UNIX
instead of AF_INET
). However, I think I would need to do some (problematic?) refactoring first.
◦ AConnectedSocket
and ABoundSocket
both use NetworkAddress
for their remoteAddress
and localAddress
which is problematic, because too restrictive. Presumably, I would have to introduce some super-class to NetworkAddress
and another sibling to NetworkAddress
(say UnixAddress
). This refactoring could ripple a lot.
◦ Rename TCPSocketNative
to ByteStreamSocketNative
as its implementation would be used as is for both TCP byte-stream sockets and IPC byte-stream sockets. (Same for TCPServerSocketNative
)
◦ Adapt the first two lines of both connect()
and bind()
(in ConnectUtilsNative.kt
) to also handle the UnixAddress
. The rest of the code would (more or less) stay as is.
That's all for now. I am quite ready to jump on the wagon, as there won't be much work to do (and I desperately need this 🤪). Please guide me on how I should proceed. Thanks in advance.e5l
09/06/2021, 3:35 PMDidier Villevalois
09/06/2021, 3:41 PMktor-network
and ktor-utils
(NetworkAddress
is there) is internal, am I wrong?Didier Villevalois
09/06/2021, 4:50 PMNetworkAddress
is in the return type of ProxyConfig.resolveAddress()
. ProxyConfig
is public and used as the type of the proxy
attribute of HttpClientEngineConfig
.
Ideally, I would like to rename NetworkAddress
as InetSocketAddress
in order to have the hierarchy:
• SocketAddress
◦ InetSocketAddress
◦ UnixSocketAddress
Do you think that would be a pain point? We could have a typealias from NetworkAddress
to InetSocketAddress
. (Note that NetworkAddress
on jvm is already a typealias to SocketAddress
.)Didier Villevalois
09/06/2021, 6:19 PMjava.net.UnixDomainSocketAddress
is only from java 16. Ktor targets an older java. I don't think there is a way to tell Kotlin to ignore if the actual class does not exist.
I would have to make a parallel hierarchy (without actual typealias
) and test if the feature exist dynamically. Is that the way to go ?