Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

SOCKADDR_IN structure (ws2def.h)

The SOCKADDR_IN structure specifies a transport address and port for the AF_INET address family.

Syntax

typedef struct sockaddr_in {
#if ...
 short sin_family;
#else
 ADDRESS_FAMILY sin_family;
#endif
 USHORT sin_port;
 IN_ADDR sin_addr;
 CHAR sin_zero[8];
} SOCKADDR_IN, *PSOCKADDR_IN;

Members

sin_family

The address family for the transport address. This member should always be set to AF_INET.

sin_port

A transport protocol port number.

sin_addr

An IN_ADDR structure that contains an IPv4 transport address.

sin_zero[8]

Reserved for system use. A WSK application should set the contents of this array to zero.

Remarks

All of the data in the SOCKADDR_IN structure, except for the address family, must be specified in network-byte-order (big-endian).

Requirements

Requirement Value
Minimum supported client Available in Windows Vista and later versions of the Windows operating systems.
Header ws2def.h (include Wsk.h)

See also

AF_INET

IN_ADDR

SOCKADDR

SOCKADDR_STORAGE


Feedback

Was this page helpful?

Additional resources