socketwrapper icon indicating copy to clipboard operation
socketwrapper copied to clipboard

Added Unix domain socket support

Open ng88 opened this issue 1 year ago • 3 comments

This adds support for Unix domain sockets (both datagrams and streams). It is mostly a hack, and if there is interest in this feature, it might be worthwhile to refactor the main code a bit. For instance, by introducing base classes for datagrams (to be derived for UDP and Unix datagrams) and streams (to be derived for TCP and Unix streams). Ideally, the ip_version parameter should also be renamed to something more generic, like family.

That said, this branch works as intended and remains fully backward compatible with previous versions.

ng88 avatar Nov 17 '24 10:11 ng88

Hey, I like the idea of adding unix domain socket support. But as you said, we should at least rename the ip_version type to something like family and than rename ip_version::v4 to family::ip_v4 and so on.

And than it might be enough to rename udp_socket class to datagram_socket and add using declarations for the ip versions and the unixsocket. That should not be to much work I think.

Would you be willing to add those changes or what do you think?

tglane avatar Nov 18 '24 19:11 tglane

Yes indeed but it will break backward compatibility, is that a problem for you?

ng88 avatar Nov 18 '24 21:11 ng88

Not really. It's just a fun side project without any real world users. If I want to try out something new (like the coroutine stuff) I just play with it. So there is no real stable version or something like that.

tglane avatar Nov 21 '24 15:11 tglane