wizard-wipeout/src-client/Client/Communication.hs

17 lines
369 B
Haskell
Raw Normal View History

module Client.Communication where
import Network.Socket
import System.IO
connectSocket
:: FilePath
-> IO Handle
connectSocket path = do
sock <- socket AF_UNIX Stream defaultProtocol
setSocketOption sock KeepAlive 1
connect sock (SockAddrUnix path)
handle <- socketToHandle sock ReadWriteMode
hSetBuffering handle (BlockBuffering Nothing)
pure handle