[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: diff. bet sockaddr & sockaddr_in ?

The definition of 'struct sockaddr' is in <sys/socket.h>.
This structure has a 14-byte protocol specific address which is 
interpreted based on type of address. For intenet family it is 
'struct sockaddr_in' defined in <netinet/in.h>

In simple words, 'struct sockaddr' is a generic socket structure and 
'struct sockaddr_in' is Internet socket address structure.

If this has confused you more, refer the book 'Unix Network Programming'
by W. Richard Stevens.


>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 3/24/01, 2:39:51 AM, M K Saravanan <mksarav@xxxxxxxxxxxxxxxxx> wrote 
regarding [LIP] diff. bet sockaddr & sockaddr_in ?:

> hi,

> In which header file "struct sockaddr" defined?  since sockaddr_in is 
> there, what is the purpose of sockaddr structure?

> -- mks --

> ---------------------------------------------
> Find out more about this and other Linux India
> mailing lists at http://lists.linux-india.org/