[#7872] Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...>

All, I needed a nonblocking socket connect for my asynchronous-event

18 messages 2006/05/14
[#7873] Re: Nonblocking socket-connect — Tanaka Akira <akr@...17n.org> 2006/05/14

In article <3a94cf510605140559l7baa0205le341dac4f47d424b@mail.gmail.com>,

[#7874] Re: Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...> 2006/05/15

How about introducing the method Socket#set_nonblocking, or alternatively

[#7875] Re: Nonblocking socket-connect — Yukihiro Matsumoto <matz@...> 2006/05/15

Hi,

[#7876] Re: Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...> 2006/05/15

Well, it's ok then. I'm comfortable adding in the nonblocking

[#7877] Re: Nonblocking socket-connect — Yukihiro Matsumoto <matz@...> 2006/05/15

Hi,

Re: Nonblocking socket-connect

From: Sam Roberts <sroberts@...>
Date: 2006-05-21 16:38:07 UTC
List: ruby-core #7915
Quoting matz@ruby-lang.org, on Sun, May 21, 2006 at 11:39:21PM +0900:
> Hi,
> 
> In message "Re: Nonblocking socket-connect"
>     on Sat, 20 May 2006 17:01:03 +0900, Tanaka Akira <akr@m17n.org> writes:
> 
> |Do you find an acceptable name?
> |
> |    connect_nonblock 
> |  nbconnect
> |    connectnb
> |    connect!
> |
> |    accept_nonblock
> |  nbaccept
> |    acceptnb
> |
> |    recvfrom_nonblock
> |  nbrecvfrom
> 
> *_nonblock sound better than others from my POV.  Any opinion?

I like the _nonblock best of the 4.

> Is there any issue other than a name left?

Is there a description somewhere of what they do, and why setting
nonblock on the socket is not sufficient?

Its a bit odd, usually ruby Socket methods mirror the BSD socket API
fairly closely, I think the problem here has to do with interactions
with threads, and ruby's implicit calling of select before making sys
calls on a descriptor, but if there is a mailing list thread  that
discusses the problem in more detail, or an RCR, could someone point it
out to me?

Thanks,
Sam


In This Thread