[Dev-C++] Socket Programming - Newbie - sockaddr 16 bytes?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Peter D. <don...@ne...> - 2004-11-06 17:20:24
|
Hi,
Can someone tell me why it is important to fill out a sockaddr structure
to 16 bytes.
Reading a book it says that the structure is as follows:
struct sockaddr {
unsigned short sa_family;
char sa_data[14];
}
Why fill it out to 16 bytes? Is this a magic number in computers?
If the address family I choose is AF_INET then how do I know that this
takes only 2 bytes in the structure? Is there a way to calculate this?
How do I know that I need to set sa_data to 14 and not 15?
Any information regarding this would be great.
Many thanks,
Peter.
|