Tim Valdez wrote:
>
> Hm.. Problem here is that if I use the object oriented interface, the
> constructor returns an undefined object, which means none of the methods
> can be called (including select). And if I skip the whole object oriented
> thing and do it simply, calling the 'connect()' function on a nonblocking
> socket fails with the error 'bad file descriptor'.
Maybe I wasn't clear. You use the OO interface and blocking mode. Then
you use IO::Select::Can_read to tell you when to do a blocking read. The
result is equiv to using a NB socket (or at least similar). Make sure you
go back to can_read after a socket returns less data than what was asked for.
> The other thing is, just to test, I called the IO::Socket::INET::new (just
> a more specific version of the same thing), got back the error 'Operation
> in progress', then slept for about a minute and the socket object was
> still undefined and $! hadn't changed. There was data on the other end of
> the socket that would have come in as soon as the connect succeeded. My
> test server on the other end never showed a connection. *But* if I took
> the timeout parameter out of the constructor, and let it do the connect in
> blocking mode, it worked fine.
>
> I'll keep hoping for something to work, but in the meantime I'm working on
> keeping track of connections that took too long, and marking domains as
> 'suspect'. Problem is I've seen nasty long connection times from valid
> sites like Yahoo that are just slow... I'll need a list of exceptions
> which just about defeats the purpose. Anyway, hopefully this thing will
> be testable soon. I've almost got my biggest worries out of the way...
>
>
> On Thu, 8 Nov 2001, Tim Valdez wrote:
>
> > >Tim Valdez wrote:
> > > >
> > > > Is there a Perl module that allows you to open and use
> non-blocking TCP
> > > > sockets that actually works? Every time IO::Socket opens a
> non-blocking
> > > > socket it immediatly returns an error when I try to use it. any
> > > suggestions?
> > >
> > >You need to use IO::Selct along with IO::Socket. Then only read a
> socket
> > >that can_read says has data and only read data till you get less
> bytes than
> > >what you ask for before going back to can_read to check for more.
--
,-/- __ _ _ $Bill Luebkert ICQ=14439852
(_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED]
/ ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web