haskell-socket
haskell-socket copied to clipboard
Creating a Socket from a file descriptor and vice versa
trafficstars
I am currently trying to add systemd socket activation to my socket-based application. Therefore I have to construct a Socket from a file descriptor, similarly to Network.Socket's mkSocket and also convert the socket to a file descriptor to store it afterwards.
I am wondering, if this would be functionality that should be added to System.Socket.Unsafe or similar, since I guess this problem arises from time to time. The biggest problem I see is ensuring that the socket and the address family/socket type match with the type we convert to in the library.
Edit: Flesh out the question.