diff options
author | Michael Koch <konqueror@gmx.de> | 2003-11-26 12:45:21 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-11-26 12:45:21 +0000 |
commit | 948888e1e174192e8c8921137038c491f22c1eea (patch) | |
tree | ff79d9b5ed0094b0b236d0b15c5fe6b883f980e6 /libjava/java/net/Socket.java | |
parent | 7fb1d711938b8cc070400f61979afe1905cbedd9 (diff) | |
download | gcc-948888e1e174192e8c8921137038c491f22c1eea.zip gcc-948888e1e174192e8c8921137038c491f22c1eea.tar.gz gcc-948888e1e174192e8c8921137038c491f22c1eea.tar.bz2 |
2003-11-26 Michael Koch <konqueror@gmx.de>
* java/net/Socket.java
(implCreated): Dont set default value explicitely, added
documentation.
(inputShutdown): Likewise.
(outputShutdown): Likewise.
(bound): New private member variable.
(bind): Set bound to true.
(close): Set bound to false.
(isBound): Return bound.
* java/net/ServerSocket.java
(bound): New private member variable.
(bind): Set bound to true.
(close): Set bound to false.
(isBound): Return bound.
From-SVN: r73949
Diffstat (limited to 'libjava/java/net/Socket.java')
-rw-r--r-- | libjava/java/net/Socket.java | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/libjava/java/net/Socket.java b/libjava/java/net/Socket.java index 1b443d0..27fa691 100644 --- a/libjava/java/net/Socket.java +++ b/libjava/java/net/Socket.java @@ -79,10 +79,25 @@ public class Socket */ private SocketImpl impl; - private boolean implCreated = false; + /** + * True if socket implementation was created by calling their create() method. + */ + private boolean implCreated; + + /** + * True if the socket is bound. + */ + private boolean bound; - private boolean inputShutdown = false; - private boolean outputShutdown = false; + /** + * True if input is shutdown. + */ + private boolean inputShutdown; + + /** + * True if output is shutdown. + */ + private boolean outputShutdown; /** * Initializes a new instance of <code>Socket</code> object without @@ -342,6 +357,7 @@ public class Socket try { getImpl().bind (tmp.getAddress(), tmp.getPort()); + bound = true; } catch (IOException exception) { @@ -995,6 +1011,7 @@ public class Socket getChannel().close(); impl = null; + bound = false; } /** @@ -1206,7 +1223,7 @@ public class Socket */ public boolean isBound () { - return getLocalAddress () != null; + return bound; } /** |