Commit 8d43449b by Noa Resare Committed by Mark Wielaard

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

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

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

From-SVN: r90178
parent c2e999df
2004-11-06 Noa Resare <noa@resare.com>
* java/net/Socket.java (getPort): Return 0 instead of -1 on
unconnected sockets.
2004-11-06 Michael Koch <konqueror@gmx.de> 2004-11-06 Michael Koch <konqueror@gmx.de>
* java/lang/StringBuffer.java, * java/lang/StringBuffer.java,
......
...@@ -520,14 +520,14 @@ public class Socket ...@@ -520,14 +520,14 @@ public class Socket
/** /**
* Returns the port number of the remote end of the socket connection. If * 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 * @return The remote port this socket is connected to
*/ */
public int getPort() public int getPort()
{ {
if (! isConnected()) if (! isConnected())
return -1; return 0;
try try
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment