aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/net/ServerSocket.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2003-11-26 12:45:21 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2003-11-26 12:45:21 +0000
commit948888e1e174192e8c8921137038c491f22c1eea (patch)
treeff79d9b5ed0094b0b236d0b15c5fe6b883f980e6 /libjava/java/net/ServerSocket.java
parent7fb1d711938b8cc070400f61979afe1905cbedd9 (diff)
downloadgcc-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/ServerSocket.java')
-rw-r--r--libjava/java/net/ServerSocket.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/libjava/java/net/ServerSocket.java b/libjava/java/net/ServerSocket.java
index d1ea4d6..7af1a33 100644
--- a/libjava/java/net/ServerSocket.java
+++ b/libjava/java/net/ServerSocket.java
@@ -73,6 +73,11 @@ public class ServerSocket
*/
private SocketImpl impl;
+ /**
+ * True if socket is bound.
+ */
+ private boolean bound;
+
/*
* This constructor is only used by java.nio.
*/
@@ -225,6 +230,7 @@ public class ServerSocket
{
impl.bind (tmp.getAddress (), tmp.getPort ());
impl.listen(backlog);
+ bound = true;
}
catch (IOException exception)
{
@@ -355,6 +361,7 @@ public class ServerSocket
getChannel().close();
impl = null;
+ bound = false;
}
}
@@ -379,16 +386,7 @@ public class ServerSocket
*/
public boolean isBound()
{
- try
- {
- Object bindaddr = impl.getOption (SocketOptions.SO_BINDADDR);
- }
- catch (SocketException e)
- {
- return false;
- }
-
- return true;
+ return bound;
}
/**