Project

General

Profile

Actions

Bug #8219

closed

ruby 2.0.0-p0 socket.recv MSG_OOB problem?

Added by windwiny (wind winy) almost 11 years ago. Updated over 4 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
Backport:
[ruby-core:53997]

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::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?

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0