LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   what is sockaddr_un (https://www.linuxquestions.org/questions/programming-9/what-is-sockaddr_un-838830/)

jamesbon 10-18-2010 10:06 AM

what is sockaddr_un
 
I searched this term on net sockaddr_un I am trying my hands from beejs network programming guide.http://beej.us/guide/bgnet/output/ht...age/bgnet.html
In this guide it is no where mentioned about struct sockaddr_un
where as I see in linux/un.h
following struct
Code:


struct sockaddr_un {
        sa_family_t sun_family; /* AF_UNIX */
        char sun_path[UNIX_PATH_MAX];  /* pathname */
};

What is the above used for?

paulsm4 10-18-2010 10:29 AM

Sockets can use many different transports, not just TCP/IP ("AF_INET").

In this case, "sockaddr_un" holds an address for "Unix sockets" ("AF_UNIX"):

http://en.wikipedia.org/wiki/Unix_domain_socket

'Hope that helps!


All times are GMT -5. The time now is 06:14 AM.