Unix ___domain socket: Difference between revisions

Content deleted Content added
Socket instantiation: Better differentiation of TCP and UDP and changed sentences to singular
Socket instantiation: Added citations
Line 104:
 
The <code>type</code> parameter will probably be one of two 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. 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 112:
|year=2010
|isbn=978-1-59327-220-3
|page=1183}}</ref>}} A Datagram socket does not guarantee reliability and is [[Connectionless communication|connectionless]]. As a result, the transmission is faster. Data are carried using the [[User Datagram Protocol]] (UDP).<ref name="lpi-p1152">{{cite book
|title=The Linux Programming Interface
|last=Kerrisk
|first=Michael
|publisher=No Starch Press
|year=2010
|isbn=978-1-59327-220-3
|page=1152}}</ref>
# <code>SOCK_RAW</code> will create an [[Internet Protocol]] (IP) [[datagram]] socket. A Raw socket skips the TCP/UDP [[transport layer]] and sends the packets directly to the [[network layer]].<ref name="lpi-p1184">{{cite book
|title=The Linux Programming Interface