FYI: GNU Classpath Socket.getPort() fixlet

Mark Wielaard mark@klomp.org
Sat Nov 6 16:46:00 GMT 2004


Hi,

This merges Socket with GNU Classpath again:

2004-11-06  Noa Resare  <noa@resare.com>

       * java/net/Socket.java (getPort): Return 0 instead of -1 on
       unconnected sockets.

Committed,

Mark

--- java/net/Socket.java        17 Oct 2004 08:29:54 -0000      1.41
+++ java/net/Socket.java        6 Nov 2004 16:42:48 -0000
@@ -520,14 +520,14 @@

   /**
    * Returns the port number of the remote end of the socket
connection.  If
-   * this socket is not connected, then -1 is returned.
+   * this socket is not connected, then 0 is returned.
    *
    * @return The remote port this socket is connected to
    */
   public int getPort()
   {
     if (! isConnected())
-      return -1;
+      return 0;

     try
       {

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20041106/71e6e60f/attachment.sig>


More information about the Java-patches mailing list