diff options
author | jfrijters <jfrijters> | 2012-05-23 18:25:32 +0400 |
---|---|---|
committer | jfrijters <jfrijters> | 2012-05-23 18:25:32 +0400 |
commit | 77c31774e6c56fea231c422ceaa7a871cabf4722 (patch) | |
tree | 920ebb6610b6b8969ba898ddfd3419c01b3c5b9a /openjdk/java/net | |
parent | 8d8c34e8824846fed277eb5034a5c7864820ee91 (diff) |
First part of forked file merge of OpenJDK 7u4 changes.
Diffstat (limited to 'openjdk/java/net')
-rw-r--r-- | openjdk/java/net/TwoStacksPlainDatagramSocketImpl.java | 7 | ||||
-rw-r--r-- | openjdk/java/net/TwoStacksPlainSocketImpl.java | 14 |
2 files changed, 17 insertions, 4 deletions
diff --git a/openjdk/java/net/TwoStacksPlainDatagramSocketImpl.java b/openjdk/java/net/TwoStacksPlainDatagramSocketImpl.java index e606c758..2ca04f17 100644 --- a/openjdk/java/net/TwoStacksPlainDatagramSocketImpl.java +++ b/openjdk/java/net/TwoStacksPlainDatagramSocketImpl.java @@ -65,7 +65,12 @@ class TwoStacksPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl protected synchronized void create() throws SocketException { fd1 = new FileDescriptor(); - super.create(); + try { + super.create(); + } catch (SocketException e) { + fd1 = null; + throw e; + } } protected synchronized void bind(int lport, InetAddress laddr) diff --git a/openjdk/java/net/TwoStacksPlainSocketImpl.java b/openjdk/java/net/TwoStacksPlainSocketImpl.java index 555db486..41790788 100644 --- a/openjdk/java/net/TwoStacksPlainSocketImpl.java +++ b/openjdk/java/net/TwoStacksPlainSocketImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ package java.net; import java.io.IOException; import java.io.FileDescriptor; +import sun.net.ResourceManager; /* * This class defines the plain SocketImpl that is used for all @@ -37,7 +38,6 @@ import java.io.FileDescriptor; * during socket creation. * * @author Chris Hegarty - * @author Jeroen Frijters */ class TwoStacksPlainSocketImpl extends AbstractPlainSocketImpl @@ -78,7 +78,12 @@ class TwoStacksPlainSocketImpl extends AbstractPlainSocketImpl */ protected synchronized void create(boolean stream) throws IOException { fd1 = new FileDescriptor(); - super.create(stream); + try { + super.create(stream); + } catch (IOException e) { + fd1 = null; + throw e; + } } /** @@ -117,6 +122,9 @@ class TwoStacksPlainSocketImpl extends AbstractPlainSocketImpl protected void close() throws IOException { synchronized(fdLock) { if (fd != null || fd1 != null) { + if (!stream) { + ResourceManager.afterUdpClose(); + } if (fdUseCount == 0) { if (closePending) { return; |