|
From: Ype K. <yk...@xs...> - 2001-01-23 19:50:03
|
>Hello, > >where can I find module select. >It's not in [My-Jython2.0-Dir]/Lib. >I got an import error if I try to >import this module. >(I.E. it's used by module telnetlib). >I have no problem with other Libs. A few days ago I checked briefly on the sockets that Java makes available and this is what I found: The 'native' Java lib does not provide a select function, so Jython cannot make use of it. The sockets that are there only a allow to check whether sockets are ready for reading, ie. you can get to the inputstream of a socket and ask for the nr. of bytes it has available. However you can't ask the socket's outputstream for the nr. of bytes it hasn't written yet, you can only flush the outputstream. Also there is no out of band data in Java, and for exceptional things (like TCP/IP errors) happening to an inputstream, you would have to catch the corresponding exception from the socket first. Read timeouts are there, and so is the TCP no delay option, as well as a shutdown and lingering on close. Non blocking reads can be done by using a very short time out. You can't do non blocking writes IIRC. I still hope I didn't look close enough, though. Regards, Ype |