Compartir a través de


sockaddr (Windows CE 5.0)

Send Feedback

This structure varies depending on the protocol selected. Except for the sa_family member, sockaddr contents are expressed in network byte order.

struct sockaddr {u_short sa_family;char sa_data[14];};

Members

  • sa_family
    Address family.
  • sa_data[14]
    Contains the address in a protocol-dependent format.

Remarks

For Winsock functions that use sockaddr, the name parameter is not strictly interpreted as a pointer to a sockaddr structure. It is presented in this manner for Windows Sockets compatibility. The actual structure is interpreted differently in the context of different address families. The only requirements are that the first u_short is the address family and the total size of the memory buffer in bytes is namelen.

The following structure declaration is used with TCP/IP. Other protocols use similar structures.

struct sockaddr_in {
    short sin_family;
    u_short sin_port;
    struct in_addr sin_addr;
    char sin_zero[8];
};

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Winsock2.h.

See Also

Windows Sockets | sockaddr_in | sockaddr_in6

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.