[#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: "Berger, Daniel" <Daniel.Berger@...>
Date: 2006-05-19 14:22:27 UTC
List: ruby-core #7910

> -----Original Message-----
> From: Carlos [mailto:angus@quovadis.com.ar] 
> Sent: Friday, May 19, 2006 1:12 AM
> To: ruby-core@ruby-lang.org
> Subject: Re: String#nstrip ?
> 
> 
> Getting STRING[0..(STRING.index(0.chr) || 0)-1]:
> 
> > STRING.split("\0").first
> 
> > STRING[0 .. STRING.index(0.chr)-1]
> 
> > STRING.scan(/^[^\000]+/).first
> 
> > STRING[/^.*?(?=\0)/]
> 
> > STRING[ /^[^\0]*/ ]
> 
> And the canonical (?):
> 
>    STRING.unpack("Z*")[0]

A little slower than the regex solutions, but not much.  Good to know,
though. :)

Dan


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.


In This Thread

Prev Next