<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Bhautik's Blog 🦉🦒🐪]]></title><description><![CDATA[An Engineer. Speaks on Architecture, backend engineering, cloud-native, virtualization, and scheduling. http://rmtsbus.in (Head). Likes Sparkling water and 🍉.]]></description><link>https://read.bhautik.in</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 16:44:13 GMT</lastBuildDate><atom:link href="https://read.bhautik.in/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Unix Sockets]]></title><description><![CDATA[Socket addressing allows you to do interprocess communication. Unix domain sockets increase efficiency by bypassing the operating system’s network stack, eliminating the overhead of traffic routing.
Types

Stream Sockets (SOCK_STREAM):

Stream socket...]]></description><link>https://read.bhautik.in/unix-sockets</link><guid isPermaLink="true">https://read.bhautik.in/unix-sockets</guid><category><![CDATA[Linux]]></category><category><![CDATA[networking]]></category><dc:creator><![CDATA[Bhautik Chudasama]]></dc:creator><pubDate>Sat, 27 Apr 2024 02:19:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/GC1syEKyWDI/upload/82f61ff187a10842e3179d7a1cb6438e.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Socket addressing allows you to do interprocess communication. Unix domain sockets increase efficiency by bypassing the operating system’s network stack, eliminating the overhead of traffic routing.</p>
<h3 id="heading-types">Types</h3>
<ol>
<li><p><strong>Stream Sockets (SOCK_STREAM)</strong>:</p>
<ul>
<li><p>Stream sockets provide a connection-oriented, reliable, two-way communication channel between processes.</p>
</li>
<li><p>This type of socket is typically used with the Transmission Control Protocol (TCP) for reliable data transmission.</p>
</li>
<li><p>Communication occurs in a continuous stream of bytes, preserving message boundaries.</p>
</li>
</ul>
</li>
<li><p><strong>Datagram Sockets (SOCK_DGRAM)</strong>:</p>
<ul>
<li><p>Datagram sockets provide connectionless, unreliable communication between processes.</p>
</li>
<li><p>They are commonly used with the User Datagram Protocol (UDP), where messages are sent in discrete packets called datagrams.</p>
</li>
<li><p>Datagram sockets do not guarantee the delivery or ordering of messages, making them suitable for applications where low overhead and speed are prioritized over reliability.</p>
</li>
</ul>
</li>
<li><p><strong>Raw Sockets (SOCK_RAW)</strong>:</p>
<ul>
<li><p>Raw sockets allow applications to directly access lower-level network protocols, such as IP, ICMP, or ICMPv6.</p>
</li>
<li><p>They provide full control over the packet headers, allowing applications to implement custom protocols or perform low-level network tasks.</p>
</li>
<li><p>Raw sockets are typically used for network diagnostic tools, protocol development, or network sniffing applications.</p>
</li>
</ul>
</li>
<li><p><strong>Sequential Packet Sockets (SOCK_SEQPACKET)</strong>:</p>
<ul>
<li><p>Sequential packet sockets provide a connection-oriented, reliable communication channel similar to stream sockets.</p>
</li>
<li><p>However, they preserve message boundaries like datagram sockets, ensuring that the data sent by one peer will be received as a whole message by the other peer.</p>
</li>
<li><p>Sequential packet sockets are not as commonly used as stream or datagram sockets but can be useful in certain scenarios where message boundaries are critical.</p>
</li>
</ul>
</li>
</ol>
]]></content:encoded></item></channel></rss>