Unix ___domain socket: Difference between revisions

Content deleted Content added
Reverted 3 edits by 94.21.161.60 (talk): Not a reliable source
correct false or misleading information which is not supported by or even contradicts cited references
Line 105:
# Between two hosts via the [[IPv4]] protocol by using the constant <code>AF_INET</code>
# Between two hosts via the [[IPv6]] protocol by using the constant <code>AF_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"/>
 
The ''Unix ___domain socket'' label is used when the <code>___domain</code> parameter's value is <code>AF_UNIX</code>. The ''Internet ___domain socket'' label is used when the <code>___domain</code> parameter's value is either <code>AF_INET</code> or <code>AF_INET6</code>.<ref name="lpi-p1197">{{cite book
Line 116 ⟶ 115:
|page=1197}}</ref>
 
The <code>type</code> parameter should be one of twofollowing common socket types: stream or datagram.<ref name="lpi-p1151"/> A third socket type is available for experimental design: raw.
# <code>SOCK_STREAM</code> will create a stream socket. A stream socket provides a reliable, bidirectional, and [[connection-oriented communication]] channel between two processes. DataFor internet ___domain sockets, data are carried using the [[Transmission Control Protocol]] (TCP).<ref name="lpi-p1151"/>
# <code>SOCK_DGRAM</code> will create a datagram socket.{{efn|A datagram ''socket'' should not be confused with a [[datagram]] [[Network packet|packet]] used in the [[network layer]].<ref name="lpi-p1183">{{cite book
|title=The Linux Programming Interface
Line 125 ⟶ 124:
|year=2010
|isbn=978-1-59327-220-3
|page=1183}}</ref>}} A Datagramdatagram socket does not guarantee reliability and is [[Connectionless communication|connectionless]]. Asand apreserves result,message theboundaries. transmissionFor isinternet faster.___domain sockets, Datadata are carried using the [[User Datagram Protocol]] (UDP).<ref name="lpi-p1152">{{cite book
|title=The Linux Programming Interface
|last=Kerrisk
Line 133 ⟶ 132:
|isbn=978-1-59327-220-3
|page=1152}}</ref>
# <code>SOCK_RAWSOCK_SEQPACKET</code> will create ana [[Internetsequenced-packet Protocol]]socket. (IP)Similar [[datagram]]to a stream socket., Ait Rawis socketconnection-oriented, skipsbut themessage TCP/UDPboundaries [[transportare layer]]preserved, andjust sendslike thedatagram packetssockets.<ref directlyname="man-unix-sockets"/> toFor theinternet ___domain sockets, [[networkStream layerControl Transmission Protocol]] is used.<ref name="lpi-p1184p1285">{{cite book
|title=The Linux Programming Interface
|last=Kerrisk
Line 140 ⟶ 139:
|year=2010
|isbn=978-1-59327-220-3
|page=11841285}}</ref>
# <code>SOCK_RAW</code> will create a raw [[Internet Protocol]] (IP) [[datagram]] socket. A raw socket bypasses the [[transport layer]] and allows applications to interface directly with the [[network layer]].<ref name="lpi-p1184">{{cite book
 
For a ''Unix ___domain socket'', data ([[network packet]]s) are passed between two connected processes via the [[transport layer]] — either TCP or UDP.<ref name="lpi-p1181">{{cite book
|title=The Linux Programming Interface
|last=Kerrisk
Line 149 ⟶ 147:
|year=2010
|isbn=978-1-59327-220-3
|page=1184}}</ref> This option is only available for internet ___domain sockets.<ref name="man-unix-sockets"/>
|page=1181}}</ref> For an ''Internet ___domain socket'', data are passed between two connected processes via the transport layer and the [[Internet Protocol]] (IP) of the [[network layer]] — either TCP/IP or UDP/IP.<ref name="lpi-p1181"/>
 
The <code>protocol</code> parameter should be set to zero for stream and datagram sockets.,<ref name="lpi-p1150"/> Forexcept for raw sockets, where the <code>protocol</code> parameter should be set to IPPROTO_RAW.<ref name="lpi-p1153">{{cite book
|title=The Linux Programming Interface
|last=Kerrisk