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