Tuesday, 15 March 2011

Priciples of Unix Domain Socket. How does it works? -



Priciples of Unix Domain Socket. How does it works? -

i doing study unix domain socket. how work. googled many times many keywords results api, scheme calls, how utilize it, examples ... . have read pipe , fifo because unix domain socket said same pipe , fifo still want know more concept/priciples of unix domain socket. how work? (maybe @ kernel level because wiki this:"this allows 2 processes open same socket in order communicate. however, communication occurs exclusively within operating scheme kernel."

i still wonder why unix domain socket documentaries less pipe or fifo? maybe because born many years ago?

could show me ideas or books/links read?

thanks in advance!

unix sockets used other socket types. means, socket scheme calls used them. difference between fifos , unix sockets, fifo utilize file sys calls, while unix sockets utilize socket calls.

unix sockets addressed files. allowes utilize file permissions access control.

unix sockets created socket sys phone call (while fifo created mkfifo). if need client socket, phone call connect, passing server socket address. if need server socket, can bind assign it's address. while, fifo open phone call used. io operation performed read/write.

unix socket can distinguish it's clients, while fifo not. info peer provided take call, returns address of peer.

unix sockets bidirectional. means every side can perform both read , write operations. while, fifos unidirectional: has author peer , reader peer.

unix sockets create less overhead , communication faster, localhost ip sockets. packet don't need go through network stack localhost sockets. , exists locally, there no routing.

if need more details about, how unix sockets works @ kernel level, please, @ net/unix/af_unix.c file in linux kernel source.

sockets unix unix-domain-sockets

No comments:

Post a Comment