mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-19 01:50:34 +08:00
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
This commit is contained in:
parent
c2e999dfeb
commit
8d43449bee
@ -1,3 +1,8 @@
|
||||
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>
|
||||
|
||||
* java/lang/StringBuffer.java,
|
||||
|
@ -520,14 +520,14 @@ public class Socket
|
||||
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user