sockstat
List the open sockets
Syntax:
sockstat [-4] [-6] [-c] [-f address_family] [-l] [-n] [-p ports] [-u] [-v]
Runs on:
QNX Neutrino
Options:
- -4
- Show AF_INET (IPv4) sockets.
- -6
- Show AF_INET6 (IPv6) sockets.
- -c
- Show connected sockets.
- -f address_family
- Limit the listed sockets to those of the specified address_family.
The following address families are recognized:
inetfor AF_INET;inet6for AF_INET6; andlocalorunixfor AF_LOCAL. - -l
- Show the listening sockets.
- -n
- Numeric output only. No attempt is made to look up symbolic names for addresses and ports.
- -p ports
- Show only Internet sockets if either the local or foreign port number is in the specified list. The ports argument is a comma-separated list of port numbers and ranges specified as a first and a last port separated by a dash.
- -u
- Show AF_LOCAL (UNIX) sockets.
- -v
- Be verbose. Enabling this option prints out the entire command name in the
NODE:CMDfield.
Description:
The sockstat command lists open Internet or UNIX domain sockets.
If you don't specify any of the -4, -6, or -u options, sockstat lists the sockets in all three domains.
If you don't specify either of the -c or -l options, sockstat lists both listening and connected sockets, as well as those sockets that are in neither state.
The information listed for each socket is:
USER- The user who owns the socket.
NODE:CMD- The command that holds the socket. When Qnet is running, this field appears as
NODE:CMD, withNODEandCMDtruncated to 10 characters if the -v option isn't enabled. PID- The process ID of the command that holds the socket.
FD- The file descriptor number of the socket.
PROTO- The transport protocol associated with the socket for Internet sockets, or the type of socket (stream or datagram) for UNIX sockets.
LOCAL ADDRESS- For Internet sockets, this is the address to which the local end of the socket is bound (see
getsockname()
in the QNX Neutrino C Library Reference).
For bound UNIX sockets, it's the socket's filename or
-. FOREIGN ADDRESS- The address to which the foreign end of the socket is bound (see
getpeername()),
or
-for unconnected UNIX sockets.
Page updated:
