+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.
+
2003-09-18 Mark Wielaard <mark@klomp.org>
Reported by Guilhem Lavaux and Julian Dolby
*/
DatagramSocketImpl impl;
- /**
- * The unique DatagramChannel object associated with this datagram socket,
- * or null.
- */
- DatagramChannel ch;
-
/**
* This is the address we are "connected" to
*/
throw new IOException (
"Socket connected to a multicast address my not receive");
- if (ch != null && !ch.isBlocking ())
+ if (getChannel() != null
+ && !getChannel().isBlocking ())
throw new IllegalBlockingModeException ();
impl.receive(p);
// FIXME: if this is a subclass of MulticastSocket,
// use getTimeToLive for TTL val.
- if (ch != null && !ch.isBlocking ())
+ if (getChannel() != null
+ && !getChannel().isBlocking ())
throw new IllegalBlockingModeException ();
impl.send(p);
*/
public DatagramChannel getChannel()
{
- return ch;
+ return null;
}
/**
*/
private SocketImpl impl;
- /**
- * ServerSocketChannel of this ServerSocket. This channel only exists
- * when the socket is created by ServerSocketChannel.open().
- */
- private ServerSocketChannel ch;
-
private boolean closed = false;
/**
bind (new InetSocketAddress (bindAddr, port), backlog);
}
- /*
- * This method may only be used by java.nio.channels.ServerSocketChannel.open.
- */
- void setChannel (ServerSocketChannel ch)
- {
- this.ch = ch;
- }
-
/**
* Binds the server socket to a specified socket address
*
protected final void implAccept (Socket s)
throws IOException
{
- if (ch != null && !ch.isBlocking())
+ if (getChannel() != null
+ && !getChannel().isBlocking())
throw new IllegalBlockingModeException();
impl.accept(s.impl);
if (impl != null)
impl.close ();
- if (ch != null)
- ch.close ();
+ if (getChannel() != null)
+ getChannel().close ();
closed = true;
}
*/
public ServerSocketChannel getChannel()
{
- return ch;
+ return null;
}
/**
private boolean inputShutdown = false;
private boolean outputShutdown = false;
- SocketChannel ch; // this field must have been set if created by SocketChannel
-
private boolean closed = false;
/**
// 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
*
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 ())
if (impl != null)
impl.close();
- if (ch != null)
- ch.close();
+ if (getChannel() != null)
+ getChannel().close();
closed = true;
}
*/
public SocketChannel getChannel()
{
- return ch;
+ return null;
}
/**