On Mon, Aug 26, 2002 at 03:07:53PM -0700, [EMAIL PROTECTED] wrote:
> 
> Well I have delved more deeply.  I'm concentrating on getting
> Client:FTP to work; I like it much better than direct Net::FTP
> calls.  I have found that it uses POE::Wheel::SocketFactory, and
> that SocketFactory says:
> 
>  # Don't block on socket operations, because the socket will be
>  # driven by a select loop.
> 
>  # Do it the Win32 way.  XXX This is incomplete.
> 
> It does indeed seems incomplete because I get:
> 
> ERROR: connect returned '10035/Unknown error' while trying to connect to
> '172.20.245.73' at C:\RSA\agent\bin\sys-agent.pl line 412.
> 
> But only after I comment out:
> 
>       # XXX EINPROGRESS is not included in ActiveState's POSIX.pm, and
>       # I don't know what AS's Perl uses instead.  What to do here?
> 
> #      if ($! and ($! != EINPROGRESS) and ($! != EWOULDBLOCK)) {
>      $poe_kernel->yield( $event_failure,
>                             'connect', $!+0, $!, $self->[MY_UNIQUE_ID]
> 
> We know that:
> 
> eval '*EWOULDBLOCK   = sub { 10035 };';
> 
> I am unclear why EWOULDBLOCK should not be logged since it does
> prevent the connect from completing.

EWOULDBLOCK indicates that the connect() call would have blocked if it
were not being done in non-blocking mode.  It has similar semantics to
EINPROGRESS, indicates that the connect() call didn't finish, but it
hasn't failed either: The socket connection is still "in progress",
and a final status will be available later.

You may find that the connect() fails some time later, after the TCP
timeout period has elapsed.  That can take up to two minutes (120
seconds) depending on your operating system.

While testing IPv6 support, I would get sockets that stalled for a
long time and then finally failed to connect.  It turned out I had
IPv6 completely firewalled (deny all) because I don't normally use it.

The "XXX This is incomplete." message is a red herring.  It seems to
have been complete enough to work for a few years now.  Likewise,
practice has proven that AS Perl uses EWOULDBLOCK, so the "XXX
EINPROGRESS" message isn't useful either.

> I am bedeviling myself by using Windows 2000 and "Binary build 631
> provided by ActiveState Tool Corp."

I don't know how long Windows 2000 waits for connect() to fail.
Uncomment the EWOULDBLOCK line in SocketFactory.pm, and be patient.
See if it doesn't fail to connect after a few minutes.

-- Rocco Caputo / [EMAIL PROTECTED] / poe.perl.org / poe.sf.net

Reply via email to