netserver/newhwserv.hs
changeset 1340 430d210d54ae
parent 1321 d7dc4e86201e
child 1341 86d7d5ab22a2
equal deleted inserted replaced
1339:8a11157c6c81 1340:430d210d54ae
    17 	(cHandle, host, port) <- accept servSock
    17 	(cHandle, host, port) <- accept servSock
    18 	cChan <- atomically newTChan
    18 	cChan <- atomically newTChan
    19 	forkIO $ clientLoop cHandle cChan
    19 	forkIO $ clientLoop cHandle cChan
    20 	atomically $ writeTChan acceptChan (ClientInfo cChan cHandle "" 0 "" False)
    20 	atomically $ writeTChan acceptChan (ClientInfo cChan cHandle "" 0 "" False)
    21 	hPutStrLn cHandle "CONNECTED\n"
    21 	hPutStrLn cHandle "CONNECTED\n"
       
    22 	hFlush cHandle
    22 	acceptLoop servSock acceptChan
    23 	acceptLoop servSock acceptChan
    23 
    24 
    24 
    25 
    25 listenLoop :: Handle -> [String] -> TChan [String] -> IO ()
    26 listenLoop :: Handle -> [String] -> TChan [String] -> IO ()
    26 listenLoop handle buf chan = do
    27 listenLoop handle buf chan = do