If 'it' is opened for reading and writing, just specify the string 'rw'.
| Or would you prefer that you do a sock.makefile('r') on it first?
| Actually that seems like a nice solution to that. Forget the statement
| above. I answered my own question.
Correct, for sockets you have to create file fileobject before being able
to select on it.
| I like that. But you should make it milliseconds since that is what
| the select() and poll() actually take. (Although for the project I am
| working on, I will probably only set it for 5-10 MINUTES :) )
The question is not what the underlying system call can handle, the
question is what makes sense from python's point of view. :-) If
anybody ever needs millisecond granularity, sure, use that. However I
doubt that it is useful...
| The problem with poll() is that on some platforms, it handles
| sockets, pipes, and files differently than select(). But I think
| that the C code should be able to select which one you wish
| to use via a #define statement when you do the compile.
Well, I assumed the select() semantics. That is, you can select on
anything (if possible; as you point out some systems have
limitations). If you don't select for an exception, and an exception
occurs for one of the fileobjects, you get a python error back
(probably with the value EBADF). Note that this is different from the
sysV poll() system call semantics...
-- Jaap Vermeulen +--------------------------+ | Sequent Computer Systems | Internet : firstname.lastname@example.org | Beaverton, Oregon | Uucp : ...uunet!sequent!jaap +--------------------------+