On Mon, Oct 28, 2002 at 02:31:09PM -0600, Garrett Goebel wrote: > I finally have the time and a work related need to look at POE again. > -Though I'm doing so with half an eye toward a presentation for our local > perl mongers group. > > I figured I'd start by whipping up a simple echo server via > POE::Component::Server::TCP and client via POE::Component::Client::TCP. Then > start peeling back the layers to see and document how it all works. > > My echo server appears to work fine. At least when I change the port to 23 > and connect to it using the standard MS Windows Telnet client. The echo > client however fails to connect. It errs out with the message: > > Client 2 got connect error 10022 (Unknown error) > > > Which according to the POE ML archives, might have something to do less than > optimal support for non-blocking io with Win32 Sockets: > http://www.mail-archive.com/cgi-bin/htsearch?method=and&format=short&config= > poe_perl_org&restrict=&exclude=&words=10022 > > I am using WinNT 4.0 sp6a, ActiveState Perl 5.6.1 build 633, and POE 0.2302. > > > I can see from ActiveStates changelog > (http://aspn.activestate.com//ASPN/Perl/Products/ActivePerl/Changes.html#bui > ld%20633%20monday,%20june%2017,%202002) that non-blocking io has been fixed > for waitpid... but the 2 activestate bugs > (http://www.mail-archive.com/poe@;perl.org/msg00511.html) do not appear to be > closed. > > Any suggestions on how to work around this? Or what I'm doing wrong?
Welcome back! I can't say that you're doing anything wrong. It still seems that perl on NT uses a socket mode that doesn't support non-blocking connect(). That leaves us stuck in the same situation unless someone can patch patch perl to work around it. Without patching perl, the best idea far is to fall back on blocking connect(). You can use IO::Socket::INET for this. ReadWrite will work with the sockets it creates. The last time I checked, IO::Socket::INET's connection timeout was implemented as non-blocking connect() and a small select() loop. If that's still true then you can't use Timeout. -- Rocco Caputo / [EMAIL PROTECTED] / poe.perl.org / poe.sf.net
