Skip to content

Commit

Permalink
Pass TCP/INET flags to socket client
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspervdj committed Feb 23, 2013
1 parent fdafac1 commit 9bb4602
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Network/WebSockets/Client.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ connectWith :: Protocol p
-> IO a
connectWith host port path origin wsProtocols app = do
-- Create and connect socket
let hints = S.defaultHints
{S.addrFamily = S.AF_INET, S.addrSocketType = S.Stream}
sock <- S.socket S.AF_INET S.Stream S.defaultProtocol
addrInfos <- S.getAddrInfo Nothing (Just host) (Just $ show port)
addrInfos <- S.getAddrInfo (Just hints) (Just host) (Just $ show port)
S.connect sock (S.addrAddress $ head addrInfos)

-- Connect WebSocket and run client
Expand Down

0 comments on commit 9bb4602

Please sign in to comment.