On Thu, Jan 13, 2000 at 04:27:03PM -0500, [EMAIL PROTECTED] wrote:
> >>>>> "GB" == Graham Barr <[EMAIL PROTECTED]> writes:
> 
>   GB> IO::Socket uses non-blocking for doing it's connects so that it can do
>   GB> a timeout without using alarm(), but it does not really provided
>   GB> an interface to do non-blocking connects via ->new(). But if
>   GB> you want to call the individual methods (bind, connect etc) then
>   GB> you can do it.
> 
> having done this in c i should be able to translate it to perl. i just
> want to use IO::Socket to hide some of the details so i don't have to go
> use perl's socket, connect, etc.
> 
> BTW: IO::Socket's pod doesn't seem to mention connect. it that wrong or
> just missing?
> 
> 
> here is my loose design:
> 
> get a plain socket with IO::Socket
> 
> make it non-blocking (any object/module ways to do that? or just use
> fcntl and O_NONBLOCK?)

Also see Ioctl.

> do $socket->connect (if that method exists as i ask above)
> 
> do write event on the socket and when it is triggered i am connected.
> the write event also has a timeout. the connect does not do a timeout
> directly or it may conflict with event.pm's timers. anyway i want the
> connect/write event to trigger one object with timeout/writable.
> 
> where in this would i pass in the host/port address? normally i would do
> that in the new, but does the connect method support that?

Have you taken a look at Event::tcp?  It uses Event::io as a base class
and layers a bunch of stuff on top of it.

> look good?
> 
> while on this note, what is the status of having a separate timeout
> method in IO events? joshua like the idea but i havent heard anyhting
> about it since i brought it up.

Huh?  IO watcher already have a timer.  What do you mean, exactly?

-- 
"Never ascribe to malice that which can be explained by stupidity."
                            via, but not speaking for Deutsche Bank

Reply via email to