3 As for net002 but reads port number and message as arguments.
4 It also prints out the IP number of the peer machine.
19 starbuck = "130.209.240.81"
20 marcus = "130.209.247.2"
24 getArgs >>= \ [port, message] ->
25 socket AF_INET Stream 6 >>= \ s ->
26 connect s (SockAddrInet (read port) (inet_addr starbuck)) >>
28 getPeerName s >>= \ (SockAddrInet p haddr) ->
29 putStr ("Connected to : " ++ (inet_ntoa haddr) ++ "\n") >>
30 writeSocket s message >>