This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: Patch: java.net.DatagramSocket
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Wed, 11 Jun 2003 12:42:03 +0200
- Subject: FYI: Patch: java.net.DatagramSocket
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi list,
I commited the attached patch to trunk to merged
java.net.DatagramSocket more with classpath's version.
Michael
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD4DBQE+5wd7WSOgCCdjSDsRAiZ/AJYvnSG6Lc3rV4GK7J7aibBUBI/vAJ0fQTtX
sP6oMxfJDxECFX8S4w5SGA==
=giuB
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.1934
diff -u -b -B -r1.1934 ChangeLog
--- ChangeLog 10 Jun 2003 17:15:18 -0000 1.1934
+++ ChangeLog 11 Jun 2003 10:32:51 -0000
@@ -1,3 +1,8 @@
+2003-06-11 Michael Koch <konqueror@gmx.de>
+
+ * java/net/DatagramSocket.java:
+ Partly merged with classpath.
+
2003-06-10 Michael Koch <konqueror@gmx.de>
* java/io/PrintStream.java:
Index: java/net/DatagramSocket.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/DatagramSocket.java,v
retrieving revision 1.25
diff -u -b -B -r1.25 DatagramSocket.java
--- java/net/DatagramSocket.java 8 Jun 2003 09:25:54 -0000 1.25
+++ java/net/DatagramSocket.java 11 Jun 2003 10:32:51 -0000
@@ -174,11 +174,28 @@
}
impl.create();
+ if (laddr == null)
+ laddr = InetAddress.ANY_IF;
- impl.bind(port, laddr == null ? InetAddress.ANY_IF : laddr);
-
- remoteAddress = null;
- remotePort = -1;
+ try
+ {
+ impl.bind (port, laddr);
+ }
+ catch (SocketException exception)
+ {
+ impl.close ();
+ throw exception;
+ }
+ catch (RuntimeException exception)
+ {
+ impl.close ();
+ throw exception;
+ }
+ catch (Error error)
+ {
+ impl.close ();
+ throw error;
+ }
}
/**