Bug #8219

ruby 2.0.0-p0 socket.recv MSG_OOB problem?

Added by wind winy about 1 year ago. Updated about 1 year ago.

[ruby-core:53997]
Status:Assigned
Priority:Normal
Assignee:Martin Bosslet
Category:-
Target version:-
ruby -v: Backport:

Description

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::MSGOOB | Socket::MSGPEEK)
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?

History

#1 Updated by Yui NARUSE about 1 year ago

  • Tracker changed from Backport to Bug
  • Project changed from Backport200 to ruby-trunk
  • Status changed from Open to Assigned
  • Assignee set to Martin Bosslet

Also available in: Atom PDF