Hey all, I have a quick question I was hoping people could clarify:

The sockaddr structure is rougly defined as:


SOCKADDR STRUC
sin_family dw ?
sin_port dw ?
sin_addr dd ?
extra db 8 dup (0)
SOCKADDR ENDS

Q: Can I use the extra 8 bytes at the end of the structure? Or does winsock intend this to be used for something?

Thanks
--Chorus
Posted on 2002-09-08 14:10:28 by chorus
Probably not... The actual sockaddr structure is defined like this:


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


It's exact structure depends on the protocol. TCP/IP uses the sockaddr_in variant, which doesn't need all 14 sa_data bytes so they added 8 zero bytes to get the right structure size. I don't think they are used but you'd better don't use them yourself since it may change in later winsock/windows versions.

Thomas
Posted on 2002-09-08 14:32:33 by Thomas
I would try it - I think they're safe to use.
Winsock 2's DLL functions use winsock 1 functions.
I think we can safely assume future winsocks will utilize the existing codebase.
In the far future sure they may well rework the entire codebase, but until such time I think its a safe bet, and by that time, his application will be jaded anyway so yeah, go for it, be wild and free and dance naked in the moonlight or whatever does it for you. I never liked rules.
Posted on 2002-09-10 02:35:14 by Homer