socket timing problem

Timothy O'Malley timo at alum.mit.edu
Thu Apr 19 23:24:55 EDT 2001


[[ This message was both posted and mailed: see
   the "To," "Cc," and "Newsgroups" headers for details. ]]

hola.

In article <uzodc4dzm.fsf at ctwd0143.fitlinxx.com>, David Bolen <db3l at fitlinxx.com> wrote:
> I was wondering - how many Windows based systems are making use of
> this?  We've tried it once or twice briefly but had some problems and
> held off until we had more time to look at it.  I was very interested
> in using it to apply timeouts to XMLRPC calls.

I've not used it much under Windows, but other people seem to have.
Periodically, I'll get comments or fixes from Windows developers.

> example, she found that the handling of connect() under Windows wasn't
> working since it returned a different result than the code expected if
> you called connect() again after a non-blocking result.

It must be that I just came back from vacation, but I'm confused by
this sentence.  What was the "non-blocking result"?  Can you give me
examples of the error.  If I can get an example, I'll see what I can
do to fix the problem.

> The wierd thing was that the select that that was supposed to wait
> until the connect succeeded (or a timeout) was just returning immediately,
> even if it hadn't finished connecting to the target machine - then the
> immediate retry of the connect() was what gave an invalid parameters
> result.

For two reasons, I think that the select() was doing the right thing.
In both cases, they basically amount to the fact that you were already
connected.
  1- If you were indeed seeing the 10022 error code, I think this
     is the Windows error (correct me if I go astray) code for a socket
     that is already connected.  It's the analog of EISCONN in the
     UNIX world.
  2- The way timeoutsocket works, it could not impact the select()
     call's behavior in this regard.  The select() routine uses the
     fileno() method of the object, and timeoutsocket does not
     define a fileno() method.  Instead, timeoutsocket passes any
     undefined method access to the underlying socket object.


> Anyway, I'm curious if there is anyone else using it successfully
> under Windows (perhaps it's an NT thing)?

Me too.



More information about the Python-list mailing list