+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.
+
2003-11-26 Michael Koch <konqueror@gmx.de>
* java/net/URL.java
*/
private SocketImpl impl;
+ /**
+ * True if socket is bound.
+ */
+ private boolean bound;
+
/*
* This constructor is only used by java.nio.
*/
{
impl.bind (tmp.getAddress (), tmp.getPort ());
impl.listen(backlog);
+ bound = true;
}
catch (IOException exception)
{
getChannel().close();
impl = null;
+ bound = false;
}
}
*/
public boolean isBound()
{
- try
- {
- Object bindaddr = impl.getOption (SocketOptions.SO_BINDADDR);
- }
- catch (SocketException e)
- {
- return false;
- }
-
- return true;
+ return bound;
}
/**
*/
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
try
{
getImpl().bind (tmp.getAddress(), tmp.getPort());
+ bound = true;
}
catch (IOException exception)
{
getChannel().close();
impl = null;
+ bound = false;
}
/**
*/
public boolean isBound ()
{
- return getLocalAddress () != null;
+ return bound;
}
/**