diff options
| author | Warren Levy <warrenl@cygnus.com> | 1999-07-20 20:30:42 +0000 |
|---|---|---|
| committer | Warren Levy <warrenl@gcc.gnu.org> | 1999-07-20 20:30:42 +0000 |
| commit | 33551dfec5a986d6e042dc61c4517af4e75fd76e (patch) | |
| tree | f8547b25c863d8ad2e1ae11a1bcc4aca6c0a8b09 /libjava/java/net/PlainDatagramSocketImpl.java | |
| parent | ce96455a31028be30569ff9fb883356348cb3d57 (diff) | |
DatagramSocket.java (DatagramSocket(int, InetAddress)): Default to using PlainDatagramSocketImpl.
* java/net/DatagramSocket.java (DatagramSocket(int, InetAddress)):
Default to using PlainDatagramSocketImpl.
* java/net/PlainDatagramSocketImpl.java (close): Catch IOException.
From-SVN: r28195
Diffstat (limited to 'libjava/java/net/PlainDatagramSocketImpl.java')
| -rw-r--r-- | libjava/java/net/PlainDatagramSocketImpl.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/libjava/java/net/PlainDatagramSocketImpl.java b/libjava/java/net/PlainDatagramSocketImpl.java index c65809129ba..a20be1cb74d 100644 --- a/libjava/java/net/PlainDatagramSocketImpl.java +++ b/libjava/java/net/PlainDatagramSocketImpl.java @@ -68,9 +68,24 @@ class PlainDatagramSocketImpl extends DatagramSocketImpl private native void mcastGrp(InetAddress inetaddr, boolean join) throws IOException; - protected void close() throws IOException + protected void close() { - fd.close(); + // FIXME: The close method in each of the DatagramSocket* classes does + // not throw an IOException. The issue is that FileDescriptor.close() + // in natFileDescriptorPosix.cc can throw one, so we have to catch + // it here. It seems that FileDescriptor.close is properly throwing + // the IOException on errors since many of the java.io classes depend + // on that. This probably requires a bit more research but for now, + // we'll catch the IOException here. + try + { + fd.close(); + } + catch (IOException e) + { + System.err.println("PlainDatagramSocketImpl.close: Error closing - " + + e.getMessage()); + } } // Deprecated in JDK 1.2. |
