Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recv nonblock specs with a buffer #825

Merged

Conversation

HoneyryderChuck
Copy link
Contributor

As per described in oracle/truffleruby#2209 (comment)

Copy link
Member

@eregon eregon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

# TODO: Figure out a good way to test non-blocking.
IO.select([@socket])
buffer = "".b
@socket.recv_nonblock(50, buffer)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems those methods need the flags as the second argument, so an extra , 0, for both cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure? According to the docs, the second arg can be either buffer or flags.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you were right, fixed!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI is still failing, this line wasn't changed it seems.

Copy link
Member

@eregon eregon Jan 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.ruby-lang.org/en/3.0.0/BasicSocket.html#method-i-recv_nonblock
They are all positional (except options), so it seems flags are needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, that extra test for tcp socket failed. fixed now.

@HoneyryderChuck HoneyryderChuck force-pushed the test-sock-recv-nonblocks-with-buffer branch 2 times, most recently from 148adc1 to 5b09df8 Compare January 7, 2021 16:57
@HoneyryderChuck HoneyryderChuck force-pushed the test-sock-recv-nonblocks-with-buffer branch from 5b09df8 to 5e0d031 Compare January 7, 2021 19:02
Copy link
Member

@eregon eregon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the specs!

@eregon eregon merged commit 7526ccb into ruby:master Jan 8, 2021
@HoneyryderChuck HoneyryderChuck deleted the test-sock-recv-nonblocks-with-buffer branch January 8, 2021 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants