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:
parent
7fb1d71193
commit
948888e1e1
3 changed files with 46 additions and 14 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue