Hi Guys,
Any of you C gurus know how to convert the following code to PB, unfortunately,
it's not included in the latest PB header files and it's a bit beyond me!
Here's the C code (from Winsock2.h - latest SDK)...
Thanks for any help,
Regards,
------------------
Kev G Peel
KGP Software, Bridgwater, UK.
mailto:[email protected][email protected]</A>
Any of you C gurus know how to convert the following code to PB, unfortunately,
it's not included in the latest PB header files and it's a bit beyond me!
Here's the C code (from Winsock2.h - latest SDK)...
Code:
/* * Portable socket structure (RFC 2553). */ /* * Desired design of maximum size and alignment. * These are implementation specific. */ #define _SS_MAXSIZE 128 // Maximum size. #define _SS_ALIGNSIZE (sizeof(__int64)) // Desired alignment. /* * Definitions used for sockaddr_storage structure paddings design. */ #define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof (short)) #define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof (short) + _SS_PAD1SIZE \ + _SS_ALIGNSIZE)) struct sockaddr_storage { short ss_family; // Address family. char __ss_pad1[_SS_PAD1SIZE]; // 6 byte pad, this is to make // implementation specific pad up to // alignment field that follows explicit // in the data structure. __int64 __ss_align; // Field to force desired structure. char __ss_pad2[_SS_PAD2SIZE]; // 112 byte pad to achieve desired size; // _SS_MAXSIZE value minus size of // ss_family, __ss_pad1, and // __ss_align fields is 112. };
Regards,
------------------
Kev G Peel
KGP Software, Bridgwater, UK.
mailto:[email protected][email protected]</A>
Comment