Compartilhar via


SOCKADDR_STORAGE (Windows CE 5.0)

Send Feedback

This structure stores socket address information. Because this structure is large enough to store IPv4 or IPv6 address information, its use promotes protocol-family and protocol-version independence, and simplifies cross-platform development. Use this structure in place of the sockaddr structure.

typedef struct sockaddr_storage {short ss_family;char __ss_pad1[_SS_PAD1SIZE];__int64 __ss_align;char __ss_pad2[_SS_PAD2SIZE];} SOCKADDR_STORAGE, *PSOCKADDR_STORAGE;

Members

  • ss_family
    Address family of the socket, such as AF_INET.
  • __ss_pad1
    Reserved. Defined as a 48-bit pad that ensures this structure achieves 64-bit alignment.
  • __ss_align
    Reserved. Used by the compiler to align the structure.
  • __ss_pad2
    Reserved. Used by the compiler to align the structure.

Remarks

Application developers should use only the ss_family member of this structure. The remaining three members ensure the structure is padded appropriately to achieve 64-bit alignment. Such alignment enables protocol-specific socket address data structures to access fields within a SOCKADDR_STORAGE structure without alignment problems. Because of its padding, the structure is 128 bytes in length.

The member field of this structure is isomorphic with the sockaddr structure to enable simplified transition from sockaddr to SOCKADDR_STORAGE.

Requirements

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

See Also

sockaddr

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.