Status - Maple Help

Sockets

 Status
 get the status of all open socket connections

 Calling Sequence Status()

Description

 • The procedure Status returns a description of the open socket connections maintained by the Sockets package. The description is in the form of a two element list. The first member of the returned list is the number of open connections. The second element is a list containing an entry for each open connection.
 • Each open socket is itself described by a list of four elements. The first element is the socket ID of the connection. The second element is a string that describes the kind of socket (one of: "client", "acceptor", "unknown", or "server"). The host name of the peer in the connection is presented as a string in the third member of the list. Finally, the peer port number is given in the fourth list element.

Examples

 > $\mathrm{with}\left(\mathrm{Sockets}\right):$
 > $\mathrm{Status}\left(\right)$
 $\left[{0}{,}\left[\right]\right]$ (1)
 > $s≔\mathrm{Open}\left("mantis","echo"\right):$
 > $\mathrm{Status}\left(\right)$
 $\left[{1}{,}\left[\left[{0}{,}{"client"}{,}{"mantis"}{,}{7}\right]\right]\right]$ (2)
 > $t≔\mathrm{Open}\left("localhost","daytime"\right):$
 > $\mathrm{Status}\left(\right)$
 $\left[{2}{,}\left[\left[{0}{,}{"client"}{,}{"mantis"}{,}{7}\right]{,}\left[{1}{,}{"client"}{,}{"localhost"}{,}{13}\right]\right]\right]$ (3)
 > $\mathrm{map}\left(\mathrm{Close},\mathrm{map2}\left(\mathrm{op},1,\mathrm{Status}\left(\right)\left[2\right]\right)\right)$
 $\left[{\mathrm{true}}{,}{\mathrm{true}}\right]$ (4)
 > $\mathrm{Status}\left(\right)$
 $\left[{0}{,}\left[\right]\right]$ (5)

References

 Information Sciences Institute, "RFC 862 Echo Protocol," ISI Home Page, http://www.isi.edu/in-notes/rfc862.txt; accessed 17 November 2005.
 Information Sciences Institute, "RFC 867 Daytime Protocol," ISI Home Page, http://www.isi.edu/in-notes/rfc867.txt; accessed 17 November 2005.