diff options
author | Michael Koch <konqueror@gmx.de> | 2004-07-17 07:34:54 +0000 |
---|---|---|
committer | Michael Koch <konqueror@gmx.de> | 2004-07-17 07:34:54 +0000 |
commit | ad052892a901bab0ecc0082d569383ee463135ce (patch) | |
tree | fe29848df61da58b5b560d0c32587ea7af7ddeff /java/net/DatagramSocket.java | |
parent | f33f9979ee68405e71fbf1f7fefa13305e7826d8 (diff) | |
download | classpath-ad052892a901bab0ecc0082d569383ee463135ce.tar.gz |
2004-07-17 Michael Koch <konqueror@gmx.de>
* java/net/DatagramSocket.java
(getLocalAddress): Check if socket is bound or not.
* java/net/Socket.java
(getLocalAddrss): Check if socket is bound or not.
(getPort): Return -1 when not connected. Dont check getImpl() for
null.
(setReuseAddress): Check if socket is closed.
(isConnected): Check if getImpl() returns null.
Diffstat (limited to 'java/net/DatagramSocket.java')
-rw-r--r-- | java/net/DatagramSocket.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/java/net/DatagramSocket.java b/java/net/DatagramSocket.java index 2808d8242..d29d12234 100644 --- a/java/net/DatagramSocket.java +++ b/java/net/DatagramSocket.java @@ -1,5 +1,6 @@ /* DatagramSocket.java -- A class to model UDP sockets - Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004 + Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -282,7 +283,7 @@ public class DatagramSocket */ public InetAddress getLocalAddress() { - if (isClosed()) + if (! isBound()) return null; InetAddress localAddr; |