Ticket #3246: accept.hs

File accept.hs, 233 bytes (added by Bart Massey, 5 years ago)

tiny Haskell program to test Network.accept

Line 
1import Control.Monad
2import System.IO
3import Network
4
5main = do
6  socket <- listenOn (PortNumber 3590)
7  forever $ do
8         (handle, host, port) <- accept socket
9         putStrLn $ host ++ ":" ++ show port
10         hClose handle