Unix ___domain socket: Difference between revisions

Content deleted Content added
See previous two edits.
Tag: Reverted
Reverted 3 edits by 94.21.161.60 (talk): Not a reliable source
Line 97:
|page=1151}}</ref>
 
# Within the same host by using the [[Constant (computer programming)|constant]] <code>AF_UNIX</code>{{efn|Alternatively, <code>PF_UNIX</code> or <code>AF_LOCAL</code> may be used.<ref name="man-unix-sockets">{{cite web
# Between two hosts via the [[IPv4]] protocol by using the constant <code>PF_INET</code>
# Between two hosts via the [[IPv6]] protocol by using the constant <code>PF_INET6</code>
# Within the same host or between two hosts via the [[Stream Control Transmission Protocol]] by using the constant <code>SOCK_SEQPACKET</code><ref name="man-unix-sockets">{{cite web
| url = http://man7.org/linux/man-pages/man7/unix.7.html
| date = 30 April 2018
| title = Linux Programmer's Manual (unix - sockets for local interprocess communication)
| access-date = 22 February 2019
| df = dmy-all}}</ref> The AF stands for "Address Family", and the PF stands for "Protocol Family".}}
# Between two hosts via the [[IPv4]] protocol by using the constant <code>PF_INETAF_INET</code>
# Between two hosts via the [[IPv6]] protocol by using the constant <code>PF_INET6AF_INET6</code>
# Within the same host or between two hosts via the [[Stream Control Transmission Protocol]] by using the constant <code>SOCK_SEQPACKET</code><ref name="man-unix-sockets"/>{{cite web
 
The ''Unix ___domain socket'' label is used when the <code>___domain</code> parameter's value is <code>PF_UNIXAF_UNIX</code>. The ''Internet ___domain socket'' label is used when the <code>___domain</code> parameter's value is either <code>PF_INETAF_INET</code> or <code>PF_INET6AF_INET6</code>.<ref>https://beej.us/guide/bgnet/html/#system-calls-or-bust</ref><ref name="lpi-p1197">{{cite book
|title=The Linux Programming Interface
|last=Kerrisk
Line 208:
int return_value;
 
server_socket_fd = socket( PF_UNIXAF_UNIX, SOCK_STREAM, 0 );
if ( server_socket_fd == -1 ) assert( 0 );
 
Line 394:
int return_value;
 
client_socket_fd = socket( PF_UNIXAF_UNIX, SOCK_STREAM, 0 );
if ( client_socket_fd == -1 ) assert( 0 );