diff options
author | Mark Spruiell <mes@zeroc.com> | 2002-04-16 23:02:05 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2002-04-16 23:02:05 +0000 |
commit | f735a39d64deba47b416e41442d1321f9c972d8c (patch) | |
tree | 12a7b8ed7c594f13ee511cec9e409669e7ad90fd /java/src/IceInternal/Network.java | |
parent | Win32 fixes for IceBox (diff) | |
download | ice-f735a39d64deba47b416e41442d1321f9c972d8c.tar.bz2 ice-f735a39d64deba47b416e41442d1321f9c972d8c.tar.xz ice-f735a39d64deba47b416e41442d1321f9c972d8c.zip |
align with C++ - fixes for the thread pool
Diffstat (limited to 'java/src/IceInternal/Network.java')
-rw-r--r-- | java/src/IceInternal/Network.java | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/java/src/IceInternal/Network.java b/java/src/IceInternal/Network.java index 67612caf124..2f5634411f3 100644 --- a/java/src/IceInternal/Network.java +++ b/java/src/IceInternal/Network.java @@ -21,7 +21,6 @@ public final class Network java.net.Socket socket = fd.socket(); socket.setTcpNoDelay(true); socket.setKeepAlive(true); - fd.configureBlocking(false); return fd; } catch (java.io.IOException ex) @@ -45,7 +44,6 @@ public final class Network //java.net.Socket socket = fd.socket(); //socket.setTcpNoDelay(true); //socket.setKeepAlive(true); - fd.configureBlocking(false); return fd; } catch (java.io.IOException ex) @@ -61,9 +59,22 @@ public final class Network { try { - java.nio.channels.DatagramChannel fd = java.nio.channels.DatagramChannel.open(); - fd.configureBlocking(false); - return fd; + return java.nio.channels.DatagramChannel.open(); + } + catch (java.io.IOException ex) + { + Ice.SocketException se = new Ice.SocketException(); + se.initCause(ex); + throw se; + } + } + + public static void + setBlock(java.nio.channels.SelectableChannel fd, boolean block) + { + try + { + fd.configureBlocking(block); } catch (java.io.IOException ex) { @@ -304,10 +315,6 @@ public final class Network java.net.Socket socket = result.socket(); socket.setTcpNoDelay(true); socket.setKeepAlive(true); - // - // Need to set non-blocking in order to use Selector - // - result.configureBlocking(false); } catch (java.io.IOException ex) { |