You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Activity
tsahara commentedon Feb 18, 2015
Ah, sorry,
iij/mruby-socketdon't supportIO::WaitWritable. I'll work on it later.But
Errno::EINPROGRESScan be used in the place ofIO::WaitWritableas a workaround.