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

IO::WaitWritable #36

Open
mowrang opened this issue Feb 18, 2015 · 1 comment
Open

IO::WaitWritable #36

mowrang opened this issue Feb 18, 2015 · 1 comment

Comments

@mowrang
Copy link

mowrang commented Feb 18, 2015

Excume me if my question is trivial. I am a newbie with ruby and starting with networking programming using mruby!

I am not able to find support of WaitWritable. I would like to run the below code using mruby.

I appreciate any suggestion!


begin
s.connect_nonblock(sockaddr)

rescue IO::WaitWritable

if IO.select(nil, [s], nil, 5)
begin
# Verify there is now a good connection
s.connect_nonblock(sockaddr)
rescue Errno::EISCONN
# Good news everybody, the socket is connected!
rescue
s.close
raise
end
else
s.close
raise "Connection timeout"
end
end

@tsahara
Copy link
Member

tsahara commented Feb 18, 2015

Ah, sorry, iij/mruby-socket don't support IO::WaitWritable. I'll work on it later.

But Errno::EINPROGRESS can be used in the place of IO::WaitWritable as a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants