2003-09-18 Michael Koch <konqueror@gmx.de>
* java/net/DatagramSocket.java (ch): Removed. (receive): Use getChannel() instead of ch. (send): Likewise. (getChannel): Return null. * java/net/ServerSocket.java (ch): Removed. (setChannel): Removed. (implAccept): Use getChannel() instead of ch. (close): Likewise. (getChannel): Return null. * java/net/Socket.java (ch): Removed. (connect): Use getChannel() instead of ch. (setChannel): Removed. (getChannel): Return null. From-SVN: r71516
This commit is contained in:
parent
780071b5a6
commit
9fd6479043
4 changed files with 34 additions and 42 deletions
|
@ -87,8 +87,6 @@ public class Socket
|
|||
private boolean inputShutdown = false;
|
||||
private boolean outputShutdown = false;
|
||||
|
||||
SocketChannel ch; // this field must have been set if created by SocketChannel
|
||||
|
||||
private boolean closed = false;
|
||||
|
||||
/**
|
||||
|
@ -298,15 +296,6 @@ public class Socket
|
|||
// that default. JDK 1.2 doc infers not to do a bind.
|
||||
}
|
||||
|
||||
/*
|
||||
* This method may only be used by java.nio.channels.ServerSocketChannel.accept and
|
||||
* java.nio.channels.SocketChannel.open.
|
||||
*/
|
||||
void setChannel (SocketChannel ch)
|
||||
{
|
||||
this.ch = ch;
|
||||
}
|
||||
|
||||
/**
|
||||
* Binds the socket to the givent local address/port
|
||||
*
|
||||
|
@ -401,7 +390,8 @@ public class Socket
|
|||
if (! (endpoint instanceof InetSocketAddress))
|
||||
throw new IllegalArgumentException ("Address type not supported");
|
||||
|
||||
if (ch != null && !ch.isBlocking ())
|
||||
if (getChannel() != null
|
||||
&& !getChannel().isBlocking ())
|
||||
throw new IllegalBlockingModeException ();
|
||||
|
||||
if (!isBound ())
|
||||
|
@ -882,8 +872,8 @@ public class Socket
|
|||
if (impl != null)
|
||||
impl.close();
|
||||
|
||||
if (ch != null)
|
||||
ch.close();
|
||||
if (getChannel() != null)
|
||||
getChannel().close();
|
||||
|
||||
closed = true;
|
||||
}
|
||||
|
@ -970,7 +960,7 @@ public class Socket
|
|||
*/
|
||||
public SocketChannel getChannel()
|
||||
{
|
||||
return ch;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue