Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sockstat(1) [linux man page]

SOCKSTAT(1)						    BSD General Commands Manual 					       SOCKSTAT(1)

NAME
sockstat -- list open sockets SYNOPSIS
sockstat [-clh] [-p ports] [-P pid|process] [-U uid|user] [-G gid|group] DESCRIPTION
The sockstat command lists open Internet or UNIX domain sockets. The following options are available: -c Show connected sockets. -l Show listening sockets. -h Show a usage summary. -p ports Only show Internet sockets if either the local or foreign port number is on the specified list. The ports argument is a comma- separated list of port numbers and ranges specified as first and last port separated by a dash. -P pid|process Only show sockets of the specified pid|process. The pid|process argument is a process name or pid. -U uid|user Only show sockets of the specified uid|user. The uid|user argument is a username or uid. -G gid|group Only show sockets of the specified gid|group. The gid|group argument is a groupname or gid. If neither -c or -l is specified, sockstat will list both listening and connected sockets. The information listed for each socket is: USER The user who owns the socket. COMMAND The command which holds the socket. PID The process ID of the command which 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 the local end of the socket is bound to (see getsockname(2)). For bound UNIX sockets, it is the socket's filename. For other UNIX sockets, it is a right arrow followed by the endpoint's filename, or ``??'' if the endpoint could not be determined. FOREIGN ADDRESS (Internet sockets only) The address the foreign end of the socket is bound to (see getpeername(2)). SEE ALSO
netstat(1), protocols(5) HISTORY
The sockstat command appeared in FreeBSD 3.1. AUTHORS
The sockstat command and this manual page were written by Dag-Erling Smorgrav <des@FreeBSD.org>. The sockstat command was ported to Linux by William Pitcock <nenolod@nenolod.net>. BSD
May 18, 2008 BSD

Check Out this Related Man Page

udp(7)							 Miscellaneous Information Manual						    udp(7)

NAME
udp - Internet user datagram protocol (UDP) SYNOPSIS
#include <sys/socket.h> #include <netinet/in.h> The following is the socket call for AF_INET sockets: s = socket(AF_INET, SOCK_DGRAM, 0); The following is the socket call for AF_INET6 sockets: s = socket(AF_INET6, SOCK_DGRAM, 0); DESCRIPTION
UDP is a simple, unreliable datagram protocol that is used to support the SOCK_DGRAM abstraction for the Internet Protocol family. UDP sockets are connectionless, and are normally used with the sendto() and recvfrom() functions, though the connect() function may also be used to fix the destination for future packets, in which case the recv() or read() and send() or write() functions may be used. UDP address formats are identical to those used by TCP. In particular, UDP provides a port identifier in addition to the normal Internet address format. Note that the UDP port space is separate from the TCP port space (that is, a UDP port may not be "connected" to a TCP port). In addition, IPv4 broadcast packets may be sent (assuming the underlying network supports this) by using a reserved "broadcast address"; this address is network interface dependent. There is no broadcast address in IPv6. Options at the IP transport level may be used with UDP; see the ip() reference page. ERRORS
If a socket operation fails, errno may be set to one of the following values: An attempt was made to create a socket with a port that has already been allocated. An attempt was made to create a socket with a network address for which no network interface exists. The socket is already connected. This error occurs when trying to establish connection on a socket or when trying to send a datagram with the desti- nation address specified. The system ran out of memory for an internal data structure. The destination address of a datagram was not specified, and the socket has not been connected. RELATED INFORMATION
Functions: getsockopt(2), recv(2), send(2), socket(2) Files: netintro(7), inet(7), ip(7) delim off udp(7)
Man Page