Winsock Core Constants

Address Families (AF_*)

ConstantValueDescription
AF_UNSPEC0Unspecified address family.
AF_INET2IPv4 Internet protocols.
AF_INET623IPv6 Internet protocols.
AF_UNIX1Local communication (POSIX only).
AF_APPLETALK16AppleTalk.
AF_BTH32Bluetooth.

Socket Types (SOCK_*)

ConstantValueDescription
SOCK_STREAM1Sequenced, reliable, two-way connection-based byte streams.
SOCK_DGRAM2Datagrams, connectionless, unreliable messages.
SOCK_RAW3Raw protocol interface.
SOCK_RDM4Reliably-delivered messages.
SOCK_SEQPACKET5Sequenced, reliable, two-way connection-based data streams with record boundaries.

Protocol Numbers (IPPROTO_*)

ConstantValueDescription
IPPROTO_IP0IP protocol.
IPPROTO_TCP6TCP protocol.
IPPROTO_UDP17UDP protocol.
IPPROTO_ICMP1ICMP protocol.
IPPROTO_ICMPV658ICMPv6 protocol.

Socket Options (SO_*)

ConstantValueDescription
SO_REUSEADDR0x0004Allows local address reuse.
SO_KEEPALIVE0x0008Keeps connections alive.
SO_BROADCAST0x0020Permits sending of broadcast messages.
SO_LINGER0x0080Controls linger behavior on close.
SO_RCVBUF0x1002Size of the receive buffer.
SO_SNDBUF0x1001Size of the send buffer.
SO_RCVTIMEO0x1006Receive timeout.
SO_SNDTIMEO0x1005Send timeout.

Message Flags (MSG_*)

ConstantValueDescription
MSG_OOB0x0001Process out-of-band data.
MSG_PEEK0x0002Peek at incoming message.
MSG_DONTROUTE0x0004Send without using routing tables.
MSG_TRUNC0x0100Data was truncated.
MSG_PROXY0x0200Used by Winsock proxy applications.

Shutdown Flags (SD_*)

ConstantValueDescription
SD_RECEIVE0Disallow further receives.
SD_SEND1Disallow further sends.
SD_BOTH2Disallow both sends and receives.