This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: GNU Classpath Socket.getPort() fixlet


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
       {

Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]