Address Families (AF_*)
| Constant | Value | Description |
|---|---|---|
| AF_UNSPEC | 0 | Unspecified address family. |
| AF_INET | 2 | IPv4 Internet protocols. |
| AF_INET6 | 23 | IPv6 Internet protocols. |
| AF_UNIX | 1 | Local communication (POSIX only). |
| AF_APPLETALK | 16 | AppleTalk. |
| AF_BTH | 32 | Bluetooth. |
Socket Types (SOCK_*)
| Constant | Value | Description |
|---|---|---|
| SOCK_STREAM | 1 | Sequenced, reliable, two-way connection-based byte streams. |
| SOCK_DGRAM | 2 | Datagrams, connectionless, unreliable messages. |
| SOCK_RAW | 3 | Raw protocol interface. |
| SOCK_RDM | 4 | Reliably-delivered messages. |
| SOCK_SEQPACKET | 5 | Sequenced, reliable, two-way connection-based data streams with record boundaries. |
Protocol Numbers (IPPROTO_*)
| Constant | Value | Description |
|---|---|---|
| IPPROTO_IP | 0 | IP protocol. |
| IPPROTO_TCP | 6 | TCP protocol. |
| IPPROTO_UDP | 17 | UDP protocol. |
| IPPROTO_ICMP | 1 | ICMP protocol. |
| IPPROTO_ICMPV6 | 58 | ICMPv6 protocol. |
Socket Options (SO_*)
| Constant | Value | Description |
|---|---|---|
| SO_REUSEADDR | 0x0004 | Allows local address reuse. |
| SO_KEEPALIVE | 0x0008 | Keeps connections alive. |
| SO_BROADCAST | 0x0020 | Permits sending of broadcast messages. |
| SO_LINGER | 0x0080 | Controls linger behavior on close. |
| SO_RCVBUF | 0x1002 | Size of the receive buffer. |
| SO_SNDBUF | 0x1001 | Size of the send buffer. |
| SO_RCVTIMEO | 0x1006 | Receive timeout. |
| SO_SNDTIMEO | 0x1005 | Send timeout. |
Message Flags (MSG_*)
| Constant | Value | Description |
|---|---|---|
| MSG_OOB | 0x0001 | Process out-of-band data. |
| MSG_PEEK | 0x0002 | Peek at incoming message. |
| MSG_DONTROUTE | 0x0004 | Send without using routing tables. |
| MSG_TRUNC | 0x0100 | Data was truncated. |
| MSG_PROXY | 0x0200 | Used by Winsock proxy applications. |
Shutdown Flags (SD_*)
| Constant | Value | Description |
|---|---|---|
| SD_RECEIVE | 0 | Disallow further receives. |
| SD_SEND | 1 | Disallow further sends. |
| SD_BOTH | 2 | Disallow both sends and receives. |