The sockets toolkit attempts to use function names similar to the standard UNIX socket function naming, so functions such as socket, connect, bind, read, write etc are available and in general would follow the same flow as if being programmed in C.
# example socket connect and request a HTML page info
s = socket(AF_INET, SOCK_STREAM, 0);
if s < 0
error ("Could not create a socket")
endif
addr = struct("addr", "google.com", "port", 80);
if connect(s, addr) < 0
error ("Could not create a socket")
endif
# html request
send(s, "HEAD / HTTP/1.0\r\n\r\n")
# read data back
[d, l] = recv(s, 2000);
if d == -1
error ("Error reading data");
endif
# display the data in human readable form
char(d)
# disconnect socket
disconnect(s);