diff options
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/IceInternal/Network.java | 55 | ||||
-rw-r--r-- | java/src/IceInternal/ThreadPool.java | 14 |
2 files changed, 13 insertions, 56 deletions
diff --git a/java/src/IceInternal/Network.java b/java/src/IceInternal/Network.java index 490a8de7554..121846d6f1c 100644 --- a/java/src/IceInternal/Network.java +++ b/java/src/IceInternal/Network.java @@ -655,49 +655,18 @@ public final class Network { SocketPair fds = new SocketPair(); - // - // TODO: This method should really be very simple. Unfortunately, - // there's a bug in the Win32 JDK (#4494292) which prevents the - // Selector from properly detecting input on a Pipe's source - // channel, so we resort to creating a socket pair. This bug has - // supposedly been fixed for JDK 1.4.1. - // - //java.nio.channels.Pipe pipe = java.nio.channels.Pipe.open(); - //fds.sink = pipe.sink(); - //fds.source = pipe.source(); - // - - java.nio.channels.ServerSocketChannel fd = createTcpServerSocket(); - - java.net.InetSocketAddress addr = new java.net.InetSocketAddress("127.0.0.1", 0); - - addr = doBind(fd, addr); - - try - { - java.nio.channels.SocketChannel sink = createTcpSocket(); - fds.sink = sink; - doConnect(sink, addr, -1); - try - { - fds.source = doAccept(fd, -1); - } - catch(Ice.LocalException ex) - { - try - { - fds.sink.close(); - } - catch(java.io.IOException e) - { - } - throw ex; - } - } - finally - { - closeSocketNoThrow(fd); - } + try + { + java.nio.channels.Pipe pipe = java.nio.channels.Pipe.open(); + fds.sink = pipe.sink(); + fds.source = pipe.source(); + } + catch(java.io.IOException ex) + { + Ice.SocketException se = new Ice.SocketException(); + se.initCause(ex); + throw se; + } return fds; } diff --git a/java/src/IceInternal/ThreadPool.java b/java/src/IceInternal/ThreadPool.java index 272dcd507b5..3a2585c33cf 100644 --- a/java/src/IceInternal/ThreadPool.java +++ b/java/src/IceInternal/ThreadPool.java @@ -276,19 +276,7 @@ public final class ThreadPool if(_fdIntrWrite != null) { - try - { - _fdIntrWrite.close(); - } - catch(java.io.IOException ex) - { - // - // Ignore this execption. It can occur due to an apparent - // bug in the JVM on some platforms such as Linux. Calling - // close throws an IOException eventhough _fdIntrWrite is - // valid. - // - } + _fdIntrWrite.close(); _fdIntrWrite = null; } |