equal
deleted
inserted
replaced
15 acceptLoop servSock acceptChan = do |
15 acceptLoop servSock acceptChan = do |
16 (cHandle, host, port) <- accept servSock |
16 (cHandle, host, port) <- accept servSock |
17 cChan <- atomically newTChan |
17 cChan <- atomically newTChan |
18 forkIO $ clientLoop cHandle cChan |
18 forkIO $ clientLoop cHandle cChan |
19 atomically $ writeTChan acceptChan (ClientInfo cChan cHandle "" 0 "" False) |
19 atomically $ writeTChan acceptChan (ClientInfo cChan cHandle "" 0 "" False) |
|
20 hPutStrLn cHandle "CONNECTED" |
20 acceptLoop servSock acceptChan |
21 acceptLoop servSock acceptChan |
21 |
22 |
22 listenLoop :: Handle -> TChan String -> IO () |
23 listenLoop :: Handle -> TChan String -> IO () |
23 listenLoop handle chan = do |
24 listenLoop handle chan = do |
24 str <- hGetLine handle |
25 str <- hGetLine handle |