<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>sockets on Ikoma's Blog</title><link>https://blog.yusukeikoma.com/tags/sockets/</link><description>Recent content in sockets on Ikoma's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 05 Oct 2026 13:20:23 +0900</lastBuildDate><atom:link href="https://blog.yusukeikoma.com/tags/sockets/index.xml" rel="self" type="application/rss+xml"/><item><title>UDP connect() Sends Nothing, and getsockname() Gives You Your Local IP</title><link>https://blog.yusukeikoma.com/posts/udp-connect-local-ip/</link><pubDate>Mon, 05 Oct 2026 13:20:23 +0900</pubDate><guid>https://blog.yusukeikoma.com/posts/udp-connect-local-ip/</guid><description>A machine with Wi-Fi, a VPN and a container bridge has several addresses, and a hostname lookup can return the wrong one. Connecting a UDP socket to a destination makes the kernel pick the source address it would use, and getsockname() reads it back without a single packet being sent. Checked on Linux with three interfaces: five destinations, five answers, no IPv4 or ARP frames on the wire.</description></item><item><title>Socket Activation Keeps Connections Waiting, Not Refused, During a systemd Restart</title><link>https://blog.yusukeikoma.com/posts/replace-running-daemon-without-downtime/</link><pubDate>Sat, 03 Oct 2026 18:08:27 +0900</pubDate><guid>https://blog.yusukeikoma.com/posts/replace-running-daemon-without-downtime/</guid><description>A runbook for replacing a running daemon without dropping requests, tested on a small TCP server under real systemd. A plain restart refused or reset connections every time; starting the new version beside the old one avoided refusals but still reset a connection in some runs, and a kernel setting made those resets go away; socket activation produced no errors. Also covered: draining in-flight work against TimeoutStopSec, and a release swap that checks the new version and rolls back.</description></item><item><title>Two write() Calls Can Stall a TCP Connection for 40 ms</title><link>https://blog.yusukeikoma.com/posts/two-small-writes-nagle-delayed-ack/</link><pubDate>Tue, 01 Sep 2026 20:56:28 +0900</pubDate><guid>https://blog.yusukeikoma.com/posts/two-small-writes-nagle-delayed-ack/</guid><description>Send a header and a body as two small write() calls, then wait for a reply, and every round trip can stall for about 40 ms on an idle machine with an idle network. Neither Nagle&amp;rsquo;s algorithm nor delayed ACK is a bug; together they deadlock until a timer fires. This post predicts the stall, reproduces it with a 50-line script, reads it off a packet trace, and compares the four ways out.</description></item><item><title>Edge-Triggered epoll Hangs After a Partial Read, and Event Streams Break the Same Way</title><link>https://blog.yusukeikoma.com/posts/level-triggered-invalidation/</link><pubDate>Tue, 25 Aug 2026 17:33:01 +0900</pubDate><guid>https://blog.yusukeikoma.com/posts/level-triggered-invalidation/</guid><description>epoll&amp;rsquo;s edge-triggered mode stalls after a partial read; level-triggered mode cannot. The same distinction decides whether a realtime client survives lost, duplicated and reordered events. A reproducible epoll experiment, a five-way simulation on a lossy channel, and a 40-line invalidator that handles the race everyone misses: an event that arrives while the refetch is running.</description></item></channel></rss>