netserver/newhwserv.hs
changeset 1081 5be338fa4e2c
parent 901 2f5ce9a584f9
child 1082 596b1dcdc1df
equal deleted inserted replaced
1080:8735046fc698 1081:5be338fa4e2c
    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