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
This commit is contained in:
committed by
Michael Koch
parent
7fb1d71193
commit
948888e1e1
@@ -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;
|
||||
|
||||
private boolean inputShutdown = false;
|
||||
private boolean outputShutdown = false;
|
||||
/**
|
||||
* True if the socket is bound.
|
||||
*/
|
||||
private boolean bound;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user