<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>closer</author_name>
  <author_url>https://blog.hatena.ne.jp/closer/</author_url>
  <blog_title>TETRIS 3</blog_title>
  <blog_url>https://closer.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>サーバ側でソケットを待ち受け、クライアント側から「Hello World!」を送信してサーバ側で表示するスクリプトを書く。server.rb require &quot;socket&quot; gs = TCPServer.open(4444) loop do Thread.start(gs.accept) do |s| while s.gets print $_ end s.close end end TCPServer#accept は接続を待ち受けるメソッド。接続があるまで待機する。client.rb require &quot;socket&quot; s = TCPSocket.open(&quot;localhost&quot;, 444…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcloser.hatenadiary.org%2Fentry%2F20081116%2F1226805621&quot; title=&quot;Ruby でソケット通信 - TETRIS 3&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>2008-11-16 12:20:21</published>
  <title>Ruby でソケット通信</title>
  <type>rich</type>
  <url>https://closer.hatenadiary.org/entry/20081116/1226805621</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
