<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>be116</author_name>
  <author_url>https://blog.hatena.ne.jp/be116/</author_url>
  <blog_title>ぶろぐめんどくさい</blog_title>
  <blog_url>https://procongame.hatenablog.com/</blog_url>
  <categories>
    <anon>技術系</anon>
  </categories>
  <description>通常、TCPと違ってUDPでは同一のポートをバインドすることができる。 はずなんだけど、「『address already in use』ばかり出るよ嘘つき！」な人へ朗報。 SO_REUSEADDRを設定するだけで、この問題が解決する。 具体的にはbind()の前に以下のコードをコピペすればいい。 u_int yes = 1; if(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &amp;yes, sizeof(yes)) &lt; 0) { perror(&quot;Reusing ADDR failed&quot;); exit(1); } これで『address already i…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fprocongame.hatenablog.com%2Fentry%2F2016%2F05%2F03%2F103503&quot; title=&quot;同一UDPポートをバインドできない？　SO_REUSEADDRを使おう - ぶろぐめんどくさい&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-05-03 10:35:03</published>
  <title>同一UDPポートをバインドできない？　SO_REUSEADDRを使おう</title>
  <type>rich</type>
  <url>https://procongame.hatenablog.com/entry/2016/05/03/103503</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
