summaryrefslogtreecommitdiff
path: root/Presence/Server.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Presence/Server.hs')
-rw-r--r--Presence/Server.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Presence/Server.hs b/Presence/Server.hs
index 55a8b57b..80a6e4ba 100644
--- a/Presence/Server.hs
+++ b/Presence/Server.hs
@@ -35,6 +35,11 @@ newtype ConnectionFinalizer = ConnectionFinalizer (IO ())
35 35
36getPacket h = do { hWaitForInput h (-1) ; fmap (fromChunks . (:[])) $ hGetNonBlocking h 1024 } 36getPacket h = do { hWaitForInput h (-1) ; fmap (fromChunks . (:[])) $ hGetNonBlocking h 1024 }
37 37
38newtype ServerHandle = ServerHandle Socket
39
40quitListening :: ServerHandle -> IO ()
41quitListening (ServerHandle socket) = sClose socket
42
38doServer addrfamily port g startCon = do 43doServer addrfamily port g startCon = do
39 doServer' addrfamily port g startCon 44 doServer' addrfamily port g startCon
40 45
@@ -68,7 +73,7 @@ doServer' family port g startCon = runServer2 port (runConn2 g)
68 forkIO $ do 73 forkIO $ do
69 mainLoop sock (ConnId 0) go 74 mainLoop sock (ConnId 0) go
70 -- L.putStrLn $ "quit accept loop" 75 -- L.putStrLn $ "quit accept loop"
71 return sock 76 return (ServerHandle sock)
72 where 77 where
73 mainLoop sock idnum@(ConnId n) go = do 78 mainLoop sock idnum@(ConnId n) go = do
74 let doException ioerror = do 79 let doException ioerror = do