For this exercise a program is open a socket to localhost on port 256 and send the message "hello socket world" before closing the socket.

Catching any exceptions or errors is not required.




link cfunc
procedure main ()
   hello("localhost", 1024)
end
 
procedure hello (host, port)
   write(tconnect(host, port) | stop("unable to connect to", host, ":", port) ,  "hello socket world")
end