diff options
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 1b443d08a1e..27fa69131b5 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; } /** |