PDA

View Full Version : what is meaning of "sin" in sin_port?



vksingh
June 1st, 2010, 02:12 PM
struct sockaddr_in {
short sin_family; // e.g. AF_INET, AF_INET6
unsigned short sin_port; // e.g. htons(3490)
struct in_addr sin_addr; // see struct in_addr, below
char sin_zero[8]; // zero this if you want to
};

In the above code, sin has been used. What is the meaning of this word "sin" with respect to
above code?

Thanks,

Vivek

trent.josephsen
June 1st, 2010, 02:17 PM
I don't know where this code comes from or what it's used for, but I'd guess from context that it's just an abbreviation for sockaddr_in.

MadCow108
June 1st, 2010, 04:02 PM
As it is the internet family structure I guess: socket internet
makes sense as e.g. unix family has sun_ -> socket unix
and link layer has sll_ -> socket link layer
etc.