summaryrefslogtreecommitdiff
path: root/gnu/java/nio/SocketChannelSelectionKey.java
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/java/nio/SocketChannelSelectionKey.java')
-rw-r--r--gnu/java/nio/SocketChannelSelectionKey.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/gnu/java/nio/SocketChannelSelectionKey.java b/gnu/java/nio/SocketChannelSelectionKey.java
index 75b4dfd87..9ceebdec9 100644
--- a/gnu/java/nio/SocketChannelSelectionKey.java
+++ b/gnu/java/nio/SocketChannelSelectionKey.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package gnu.java.nio;
+import java.io.IOException;
import java.nio.channels.spi.AbstractSelectableChannel;
public final class SocketChannelSelectionKey
@@ -49,10 +50,16 @@ public final class SocketChannelSelectionKey
super (channel, selector);
}
+ // FIXME don't use file descriptor integers
public int getNativeFD()
{
- NIOSocket socket =
- (NIOSocket) ((SocketChannelImpl) ch).socket();
- return socket.getPlainSocketImpl().getNativeFD();
+ try
+ {
+ return ((SocketChannelImpl) ch).getVMChannel().getState().getNativeFD();
+ }
+ catch (IOException ioe)
+ {
+ throw new IllegalStateException(ioe);
+ }
}
}