Socket Device Operation

Each socket may be in one of the following states:

A server socket used for accepting new connections goes through the first two states in one step with a single OPEN or in two steps with an OPEN and a USE. When a server does a WRITE /WAIT on a Bound socket, a client can establish a connection which Creates another server socket that is Connected. In server operation, $KEY supplies the port value when a socket is bound (important when port 0 is specified to get the system to choose the port), and a socket id when a Connected socket is created. A client socket goes through the first and third states with a single OPEN or in two steps with an OPEN and a USE.