Command | Meaning |
---|---|
socket symname service@hostname | Creates a socket and associate it with the symbolic name symname in the same manner that the pipe command did. Connect this socket with the host hostname at the TCP port specified by service. Here service may be either a numeric port specifier or a symbolic one, in which case getservbyname is used to lookup the service in /etc/services. |
sclose symname how | If how is omitted, close the socket and disassociate the symbolic name symname from it. If how is specified, it must be 0, 1, or 2, and the socket is shut down (see shutdown(3n)) with that argument. A socket shutdown with a how of 2, or shutdown both 0 and 1 separately will have both send and receive sides shut down, and should free up the symbolic name. A half-shutdown socket should not free up the symbolic name. |
You may test out your implementation by using a simple server that I'm running on 7000@play.ucsd.edu:
$ netd -p 7000 -- cat(You can run such a server yourself.)
You can, for example, run:
Y$ socket s 7000@play.ucsd.edu Y$ cat somefile >| s & Y$ sclose s 1 Y$ cat <| s contents of ``somefile'' Y$ sclose s Y$
More creatively, we could run:
$ netd -p 7001 -- seussifyand run:
Y$ socket s 7001@play.ucsd.edu Y$ cat green_eggs >| s & Y$ sclose s 1 Y$ cat <| s edited contents of the file green_eggs Y$ sclose s Y$
38 students handed in assignment 4. assignment 4 as a whole: mean 74.3421 stdev 23.9124 w/o late adjustment: mean 74.3421 stdev 23.9124 Excluding all-zero scores: assignment 4 as a whole: mean 80.7143 stdev 10.3194 w/o late adjustment: mean 80.7143 stdev 10.3194 Per-problem statistics: Num 1: mean 74.342105 stdev 23.912424 Per-problem statistics, omitting zero grades: Num 1: mean 80.714286 stdev 10.319389
bsy+cse190.s00@cs.ucsd.edu, last updated
email bsy.