From ed08cfe4cd05b81e9dbdf33866c8e292a424fb67 Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Wed, 25 Sep 2002 05:05:07 +0000 Subject: 2002-09-25 Michael Koch * java/net/DatagramPacket (DatagramPacket): Exception documentation added. (setData): Likewise. (setSocketAddress): Likewise. * java/net/DatagramSocketImpl.java (peek): Documentation addded. (peekData): Documentation addded. (send): Documentation addded. (receive): Documentation addded. (connect): New method. (disconnect): New method. (joinGroup): New abstract method. (leaveGroup): New abstract method. * java/net/InetSocketAddress.java (InetSocketAddress): Documentation added. (equals): final keyword added. (getAddress): final keyword added. (getHostName): final keyword added. (getPort): final keyword added. (hashCode): final keyword added. (isUnresolved): final keyword added. * java/net/MulticastSocket.java (MulticastSocket): Documentation added. (MulticastSocket): New method. (joinGroup): Documentation added. (joinGroup): New method. (leaveGroup): Documentation added. (leaveGroup): New method. (send): Documentation added. * java/net/NetworkInterface.java (getByName): Documentation added. (getByInetAddress): Documentation added. (getNetworkInterfaces): Documentation added. * java/net/PlainDatagramSocketImpl.java (connect): New method. (disconnect): New method. * java/net/SocketImpl.java (create): Documentation added. (shutdownInput): Convert public to protected, as it always was. (shutdownOutput): Convert public to protected, as it always was. * java/net/SocketOptions.java (whole file): Reintented. * java/net/URLClassLoader.java (URLClassLoader): SecurityManager check added, documentation added. (findResources): Documentation added. (findClass): Documentation added. (newInstance): More correct method arguments. * java/net/URLConnection.java (connect): Documentation added. (getContent): Documentation added. (getPermission): Documentation added. (getInputStream): Documentation added. (getOutputStream): Documentation added. (setDoInput): Throw correct exception, documentation added. (setDoOutput): Throw correct exception, documentation added. (setAllowUserInteraction): Throw correct exception, documentation added. (setUseCaches): Throw correct exception, documentation added. (setIfModifiedSince): Throw correct exception, documentation added. (setRequestProperty): Throw exception, documentation added. (addRequestProperty): Throw exception, documentation added. (getRequestProperty): Throw exception, documentation added. (getRequestProperties): Documentation added. (setContentHandlerFactory): Documentation added. (guessContentTypeFromName): protected to public. (setFileNameMap): Documentation added. * java/net/URLDecoder.java (URLDecoder): New method. (decode): Documentation added. (whole file): Reindented. * java/net/URLEncoder.java (encode): Documentation added. * java/net/natPlainDatagramSocketImpl.cc (connect): New method. (disconnect): New method. * javax/naming/RefAddr: (addrType): addrType was never final. (equals): Fix typo in method name. * javax/naming/BinaryRefAddr: (equals): Fix typo in method name. From-SVN: r57487 --- libjava/java/net/DatagramSocketImpl.java | 66 ++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'libjava/java/net/DatagramSocketImpl.java') diff --git a/libjava/java/net/DatagramSocketImpl.java b/libjava/java/net/DatagramSocketImpl.java index 6f10a78b190..5a0aa3e4acd 100644 --- a/libjava/java/net/DatagramSocketImpl.java +++ b/libjava/java/net/DatagramSocketImpl.java @@ -108,6 +108,9 @@ public abstract class DatagramSocketImpl implements SocketOptions * @return The port number of the sender of the packet * * @exception IOException If an error occurs + * @exception PortUnreachableException May be thrown if the socket is + * connected to a currently unreachable destination. Note, there is no + * guarantee that the exception will be thrown. */ protected abstract int peek(InetAddress i) throws IOException; @@ -120,6 +123,9 @@ public abstract class DatagramSocketImpl implements SocketOptions * @return The port number of the sender of the packet. * * @exception IOException If an error occurs + * @exception PortUnreachableException May be thrown if the socket is + * connected to a currently unreachable destination. Note, there is no + * guarantee that the exception will be thrown. * * @since 1.4 */ @@ -132,6 +138,9 @@ public abstract class DatagramSocketImpl implements SocketOptions * @param p The packet to send * * @exception IOException If an error occurs + * @exception PortUnreachableException May be thrown if the socket is + * connected to a currently unreachable destination. Note, there is no + * guarantee that the exception will be thrown. */ protected abstract void send(DatagramPacket p) throws IOException; @@ -143,9 +152,37 @@ public abstract class DatagramSocketImpl implements SocketOptions * @param p A place to store the incoming packet. * * @exception IOException If an error occurs + * @exception PortUnreachableException May be thrown if the socket is + * connected to a currently unreachable destination. Note, there is no + * guarantee that the exception will be thrown. */ protected abstract void receive(DatagramPacket p) throws IOException; + /** + * Connects the socket to a host specified by address and port. + * + * @param address The InetAddress of the host to connect to + * @param port The port number of the host to connect to + * + * @exception SocketException If an error occurs + * + * @since 1.4 + */ + protected void connect (InetAddress address, int port) throws SocketException + { + // This method has to be overwritten by real implementations + } + + /** + * Disconnects the socket. + * + * @since 1.4 + */ + protected void disconnect () + { + // This method has to be overwritten by real implementations + } + /** * Sets the Time to Live (TTL) setting on this socket to the specified * value. Use setTimeToLive(int) instead. @@ -202,6 +239,35 @@ public abstract class DatagramSocketImpl implements SocketOptions */ protected abstract void leave(InetAddress inetaddr) throws IOException; + /** + * Causes this socket to join the specified multicast group on a specified + * device + * + * @param mcastaddr The address to leave + * @param netIf The specified network interface to join the group at + * + * @exception IOException If an error occurs + * + * @since 1.4 + */ + protected abstract void joinGroup (SocketAddress mcastaddr, + NetworkInterface netIf) + throws IOException; + + /** + * Leaves a multicast group + * + * @param mcastaddr The address to join + * @param netIf The specified network interface to leave the group at + * + * @exception IOException If an error occurs + * + * @since 1.4 + */ + protected abstract void leaveGroup (SocketAddress mcastaddr, + NetworkInterface netIf) + throws IOException; + /** * Returns the FileDescriptor for this socket */ -- cgit v1.2.3