[#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: String#nstrip ?

From: ara.t.howard@...
Date: 2006-05-18 19:16:43 UTC
List: ruby-core #7904
On Fri, 19 May 2006, Daniel Berger wrote:

> Hi all,
>
> When using the Win32API package, I often have to resort to this idiom to get 
> a string out of a buffer:
>
> string.split(0.chr).first
>
> The problem is that it's kinda slow.  No, I can't use String#rstrip or 
> String#gsub because often there's other junk at the end of the string that 
> would prevent those methods from working.
>
> What about adding a String#nstrip (null strip) method that would return a 
> string up to the first NULL character?  Here's a simple implementation:

harp:~ > ruby -e'  p "42\0\0"[ /^[^\0]*/ ]  '
"42"

harp:~ > ruby -e'  p "42"[ /^[^\0]*/ ]  '
"42"

harp:~ > ruby -e'  p ""[ /^[^\0]*/ ]  '
""

regards.

-a
-- 
be kind whenever possible... it is always possible.
- h.h. the 14th dali lama

In This Thread

Prev Next