Where can I find some actual examples of sendFile function (Network.Socket.SendFile lib). When I tried to do all by official manual, I got an error:
Exception: {file path}: withFd: resource vanished (Broken pipe)
is it some light-sense example of function usage?
Here is source:
withSocketsDo $ do
sock <- socket AF_INET Stream defaultProtocol
bindSocket sock (SockAddrInet 1212 0)
sendFile sock "/some/path/to/file"