9 getArgs >>= \ [host, port, message] ->
10 getProtocolNumber "tcp" >>= \ proto ->
11 socket AF_INET Stream proto >>= \ s ->
12 getHostByName host >>= \ (HostEntry _ _ _ haddrs) ->
13 connect s (SockAddrInet (read port)
16 getPeerName s >>= \ (SockAddrInet _ haddr) ->
17 getHostByAddr AF_INET haddr >>= \ (HostEntry hname _ _ _) ->
18 putStr ("Connected to : " ++ hname ++ "\n") >>
19 writeSocket s message >>