mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
fix MSG_OOB spec
* OOBINLINE should be set for accepted socket * When OOBINLINE is set, MSG_OOB shouldn't be passed to recv Merge spec/ruby's commit 5b418374f8006318434ee9a2366382d004f585df git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e0cece9d4d
commit
4b13656e39
1 changed files with 3 additions and 9 deletions
|
@ -196,17 +196,11 @@ describe 'BasicSocket#send' do
|
|||
|
||||
describe 'using the MSG_OOB flag' do
|
||||
it 'sends an out-of-band message' do
|
||||
@server.setsockopt(:SOCKET, :OOBINLINE, true)
|
||||
|
||||
@client.send('a', Socket::MSG_OOB).should == 1
|
||||
|
||||
platform_is :freebsd do # recv hangs otherwise
|
||||
@client.close
|
||||
end
|
||||
|
||||
socket, _ = @server.accept
|
||||
socket.setsockopt(:SOCKET, :OOBINLINE, true)
|
||||
@client.send('a', Socket::MSG_OOB).should == 1
|
||||
begin
|
||||
socket.recv(1, Socket::MSG_OOB).should == 'a'
|
||||
socket.recv(10).should == 'a'
|
||||
ensure
|
||||
socket.close
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue