From: "windwiny (wind winy)" Date: 2013-04-05T00:29:59+09:00 Subject: [ruby-core:53997] [Backport 200 - Backport #8219][Open] ruby 2.0.0-p0 socket.recv MSG_OOB problem? Issue #8219 has been reported by windwiny (wind winy). ---------------------------------------- Backport #8219: ruby 2.0.0-p0 socket.recv MSG_OOB problem? https://bugs.ruby-lang.org/issues/8219 Author: windwiny (wind winy) Status: Open Priority: Normal Assignee: Category: Target version: server1.rb ------- require 'socket' ssc = TCPServer.new '', 9989 sc = ssc.accept p sc.recv(1024) p sc.recv(1024) # ruby 2.0.0p0: has OOB data, not return until remote send data again or close p sc.recv(1024, Socket::MSG_OOB) p sc.recv(1024, Socket::MSG_OOB | Socket::MSG_PEEK) p sc.recv(1024, Socket::MSG_OOB) p sc.recv(1024) ------ client1.rb ------------- require 'socket' sc=TCPSocket.new '127.0.0.1', 9989 sc.send '1234', 0 sleep 1.5 sc.send 'abcd', Socket::MSG_OOB sleep 3 sc.send 'EFGH', Socket::MSG_OOB sleep 1.5 ---------------- Use ruby 2.0.0p0 run above server1 code, output is "1234" "abc" "dH" "" "" "EFG" , use ruby 1.9.3p327 or python or c code, output is "1234" "abc" "d" "H" "H" "EFG" Is this has a bug? -- http://bugs.ruby-lang.org/