diff options
author | jfrijters <jfrijters> | 2011-03-02 10:32:50 +0300 |
---|---|---|
committer | jfrijters <jfrijters> | 2011-03-02 10:32:50 +0300 |
commit | 34a7d1d2f4c38d614372d20c3f0482b39a3430d4 (patch) | |
tree | 8f177b60e9e6d3b581f06f41276d9e4cee05ff58 /openjdk/sun/nio/ch/DatagramChannelImpl.java | |
parent | 23ba2f8b00e9317fc579932a6c9a8e0d9600d518 (diff) |
Update to OpenJDK 6 b22.
Diffstat (limited to 'openjdk/sun/nio/ch/DatagramChannelImpl.java')
-rw-r--r-- | openjdk/sun/nio/ch/DatagramChannelImpl.java | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/openjdk/sun/nio/ch/DatagramChannelImpl.java b/openjdk/sun/nio/ch/DatagramChannelImpl.java index e8f956ab..1f1707a3 100644 --- a/openjdk/sun/nio/ch/DatagramChannelImpl.java +++ b/openjdk/sun/nio/ch/DatagramChannelImpl.java @@ -32,6 +32,7 @@ import java.nio.ByteBuffer; import java.nio.channels.*; import java.nio.channels.spi.*; import java.lang.ref.SoftReference; +import sun.net.ResourceManager; /** @@ -97,16 +98,22 @@ class DatagramChannelImpl throws IOException { super(sp); - this.fd = Net.socket(false); - this.state = ST_UNCONNECTED; - try - { - if (false) throw new cli.System.Net.Sockets.SocketException(); - fd.getSocket().IOControl(SIO_UDP_CONNRESET, new byte[] { 0 }, null); - } - catch (cli.System.Net.Sockets.SocketException x) - { - throw SocketUtil.convertSocketExceptionToIOException(x); + ResourceManager.beforeUdpCreate(); + try { + this.fd = Net.socket(false); + this.state = ST_UNCONNECTED; + try + { + if (false) throw new cli.System.Net.Sockets.SocketException(); + fd.getSocket().IOControl(SIO_UDP_CONNRESET, new byte[] { 0 }, null); + } + catch (cli.System.Net.Sockets.SocketException x) + { + throw SocketUtil.convertSocketExceptionToIOException(x); + } + } catch (IOException ioe) { + ResourceManager.afterUdpClose(); + throw ioe; } } @@ -515,6 +522,7 @@ class DatagramChannelImpl protected void implCloseSelectableChannel() throws IOException { synchronized (stateLock) { closeImpl(); + ResourceManager.afterUdpClose(); long th; if ((th = readerThread) != 0) NativeThread.signal(th); |