Message1683
Hi,
I am having an issue with select. I am thinking that it may be Java version related. When I run this script:
import socket, select
import sys
print sys.version
print sys.platform
s1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s1.bind(('', 9000))
s1.listen(1)
s2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s2.bind(('', 9001))
s2.listen(5)
while True:
input, output, exc = select.select([s1, s2], [], [], 0)
for sock in input:
client = sock.accept()
print 'accepting client'
time.sleep(1.0)
client.close()
print 'client closed'
I get this for a result:
2.2rc1
java1.6.0_01
Traceback (innermost last):
File "C:\Documents and Settings\bob\My Documents\WirelessX\Jython22Tests\src\SimpleSelectServer.py", line 18, in ?
File "C:\jython2.2rc1\Lib\select.py", line 137, in select
File "C:\jython2.2rc1\Lib\select.py", line 74, in register
File "C:\jython2.2rc1\Lib\select.py", line 54, in _register_channel
at java.nio.channels.spi.AbstractSelectableChannel.register(Unknown Source)
at java.nio.channels.SelectableChannel.register(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
java.nio.channels.IllegalBlockingModeException: java.nio.channels.IllegalBlockingModeException
I am putting the version and platform info in this, because I think I am using a newer version of Java than you are.
|
|
Date |
User |
Action |
Args |
2008-02-20 17:17:52 | admin | link | issue1745068 messages |
2008-02-20 17:17:52 | admin | create | |
|