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