gcc/libjava/java/net/Socket.java

1284 lines
35 KiB
Java
Raw Normal View History

/* Socket.java -- Client socket implementation
Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
1999-04-07 16:42:40 +02:00
package java.net;
1999-04-07 16:42:40 +02:00
import gnu.java.net.PlainSocketImpl;
import java.io.IOException;
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
import java.io.InputStream;
import java.io.OutputStream;
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Initialize new instance variables. (close): Reset new instance variables. (getLocalAddress): Remove unneeded SecurityManager usage. (getLocalPort): Check if socket is already bound. (isConnected): New method. (getInetAddress): Implemented. (getPort): Better Implementation, documentation fixed. (getRemoteSocketAddress): New method. * java/net/JarURLConnection.java (element): Typo fixed. (getMainAttributes): New method. (getAttributes): New method (stub only). (getManifest): New method (stub only). * java/net/NetPermission.java: Added serialVersionsUID. * java/net/Socket.java (connect): Check blocking mode of associated channel, documentation added. (getLocalSocketAddress): Better implementation. (getRemoteSocketAddress): Implemented. (isBound): New method. (setSendBufferSize): Documentation added. * java/net/SocketAddress.java: Added serialVersionsUID. * java/net/SocketPermission.java: Added serialVersionsUID. * java/net/URL.java (URL): Wrap for shorter lines, initialize new instance variables, documentation added. (equals): Check new instance variables too. (getContent): Documentation added. (getPath): Documentation added. (getAuthority): New method. (getHost): Documentation added. (getPort): Documentation added. (getDefaultPort): New method. (getProtocol): Documentation added. (getUserInfo): Documentation added. (set): Initialize new instance variables, documentation added. * java/net/URLStreamHandler.java (setURL): New method. * java/net/natPlainDatagramSocketImpl.cc (connect): Fix exception name. (disconnect): Fix exception name. From-SVN: r57501
2002-09-25 19:14:09 +02:00
import java.nio.channels.IllegalBlockingModeException;
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
import java.nio.channels.SocketChannel;
1999-04-07 16:42:40 +02:00
/* Written using on-line Java Platform 1.2 API Specification.
* Status: I believe all methods are implemented.
*/
1999-04-07 16:42:40 +02:00
/**
* This class models a client site socket. A socket is a TCP/IP endpoint
* for network communications conceptually similar to a file handle.
* <p>
* This class does not actually do any work. Instead, it redirects all of
* its calls to a socket implementation object which implements the
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* <code>SocketImpl</code> interface. The implementation class is
* instantiated by factory class that implements the
* <code>SocketImplFactory interface</code>. A default
* factory is provided, however the factory may be set by a call to
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* the <code>setSocketImplFactory</code> method. Note that this may only be
* done once per virtual machine. If a subsequent attempt is made to set the
* factory, a <code>SocketException</code> will be thrown.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
* @author Per Bothner (bothner@cygnus.com)
*/
1999-04-07 16:42:40 +02:00
public class Socket
{
/**
* This is the user SocketImplFactory for this class. If this variable is
* null, a default factory is used.
*/
1999-04-07 16:42:40 +02:00
static SocketImplFactory factory;
/**
* The implementation object to which calls are redirected
*/
// package-private because ServerSocket.implAccept() needs to access it.
SocketImpl impl;
1999-04-07 16:42:40 +02:00
/**
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* True if socket implementation was created by calling their
* create() method.
*/
// package-private because ServerSocket.implAccept() needs to access it.
boolean implCreated;
/**
* 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;
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
/**
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* Initializes a new instance of <code>Socket</code> object without
* connecting to a remote host. This useful for subclasses of socket that
* might want this behavior.
*
* @specnote This constructor is public since JDK 1.4
* @since 1.1
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public Socket()
1999-04-07 16:42:40 +02:00
{
if (factory != null)
impl = factory.createSocketImpl();
else
impl = new PlainSocketImpl();
1999-04-07 16:42:40 +02:00
}
/**
* Initializes a new instance of <code>Socket</code> object without
* connecting to a remote host. This is useful for subclasses of socket
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* that might want this behavior.
* <p>
* Additionally, this socket will be created using the supplied
* implementation class instead the default class or one returned by a
* factory. If this value is <code>null</code>, the default Socket
* implementation is used.
*
* @param impl The <code>SocketImpl</code> to use for this
* <code>Socket</code>
*
* @exception SocketException If an error occurs
*
* @since 1.1
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
protected Socket(SocketImpl impl) throws SocketException
1999-04-07 16:42:40 +02:00
{
if (impl == null)
this.impl = new PlainSocketImpl();
else
this.impl = impl;
1999-04-07 16:42:40 +02:00
}
/**
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* Initializes a new instance of <code>Socket</code> and connects to the
* hostname and port specified as arguments.
*
* @param host The name of the host to connect to
* @param port The port number to connect to
*
* @exception UnknownHostException If the hostname cannot be resolved to a
* network address.
* @exception IOException If an error occurs
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
* @exception SecurityException If a security manager exists and its
* checkConnect method doesn't allow the operation
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public Socket(String host, int port)
1999-04-07 16:42:40 +02:00
throws UnknownHostException, IOException
{
this(InetAddress.getByName(host), port, null, 0, true);
1999-04-07 16:42:40 +02:00
}
/**
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* Initializes a new instance of <code>Socket</code> and connects to the
* address and port number specified as arguments.
*
* @param address The address to connect to
* @param port The port number to connect to
*
* @exception IOException If an error occurs
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
* @exception SecurityException If a security manager exists and its
* checkConnect method doesn't allow the operation
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public Socket(InetAddress address, int port) throws IOException
1999-04-07 16:42:40 +02:00
{
this(address, port, null, 0, true);
1999-04-07 16:42:40 +02:00
}
/**
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* Initializes a new instance of <code>Socket</code> that connects to the
* named host on the specified port and binds to the specified local address
* and port.
*
* @param host The name of the remote host to connect to.
* @param port The remote port to connect to.
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
* @param localAddr The local address to bind to.
* @param localPort The local port to bind to.
*
* @exception SecurityException If the <code>SecurityManager</code>
* exists and does not allow a connection to the specified host/port or
* binding to the specified local host/port.
* @exception IOException If a connection error occurs.
*
* @since 1.1
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public Socket(String host, int port, InetAddress localAddr, int localPort)
throws IOException
1999-04-07 16:42:40 +02:00
{
this(InetAddress.getByName(host), port, localAddr, localPort, true);
1999-04-07 16:42:40 +02:00
}
/**
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* Initializes a new instance of <code>Socket</code> and connects to the
* address and port number specified as arguments, plus binds to the
* specified local address and port.
*
* @param address The remote address to connect to
* @param port The remote port to connect to
* @param localAddr The local address to connect to
* @param localPort The local port to connect to
*
* @exception IOException If an error occurs
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
* @exception SecurityException If a security manager exists and its
* checkConnect method doesn't allow the operation
*
* @since 1.1
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public Socket(InetAddress address, int port, InetAddress localAddr,
int localPort) throws IOException
1999-04-07 16:42:40 +02:00
{
this(address, port, localAddr, localPort, true);
1999-04-07 16:42:40 +02:00
}
/**
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* Initializes a new instance of <code>Socket</code> and connects to the
* hostname and port specified as arguments. If the stream argument is set
* to <code>true</code>, then a stream socket is created. If it is
* <code>false</code>, a datagram socket is created.
*
* @param host The name of the host to connect to
* @param port The port to connect to
* @param stream <code>true</code> for a stream socket, <code>false</code>
* for a datagram socket
*
* @exception IOException If an error occurs
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
* @exception SecurityException If a security manager exists and its
* checkConnect method doesn't allow the operation
*
* @deprecated Use the <code>DatagramSocket</code> class to create
* datagram oriented sockets.
1999-04-07 16:42:40 +02:00
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public Socket(String host, int port, boolean stream)
throws IOException
1999-04-07 16:42:40 +02:00
{
this(InetAddress.getByName(host), port, null, 0, stream);
1999-04-07 16:42:40 +02:00
}
/**
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* Initializes a new instance of <code>Socket</code> and connects to the
* address and port number specified as arguments. If the stream param is
* <code>true</code>, a stream socket will be created, otherwise a datagram
* socket is created.
*
* @param host The address to connect to
* @param port The port number to connect to
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* @param stream <code>true</code> to create a stream socket,
* <code>false</code> to create a datagram socket.
*
* @exception IOException If an error occurs
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
* @exception SecurityException If a security manager exists and its
* checkConnect method doesn't allow the operation
*
* @deprecated Use the <code>DatagramSocket</code> class to create
* datagram oriented sockets.
1999-04-07 16:42:40 +02:00
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public Socket(InetAddress host, int port, boolean stream)
throws IOException
1999-04-07 16:42:40 +02:00
{
this(host, port, null, 0, stream);
}
/**
* This constructor is where the real work takes place. Connect to the
* specified address and port. Use default local values if not specified,
* otherwise use the local host and port passed in. Create as stream or
* datagram based on "stream" argument.
* <p>
*
* @param raddr The remote address to connect to
* @param rport The remote port to connect to
* @param laddr The local address to connect to
* @param lport The local port to connect to
* @param stream true for a stream socket, false for a datagram socket
*
* @exception IOException If an error occurs
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
* @exception SecurityException If a security manager exists and its
* checkConnect method doesn't allow the operation
*/
private Socket(InetAddress raddr, int rport, InetAddress laddr, int lport,
boolean stream) throws IOException
{
this();
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
SecurityManager sm = System.getSecurityManager();
if (sm != null)
sm.checkConnect(raddr.getHostName(), rport);
// bind socket
SocketAddress bindaddr =
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
laddr == null ? null : new InetSocketAddress(laddr, lport);
bind(bindaddr);
// connect socket
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
connect(new InetSocketAddress(raddr, rport));
// FIXME: JCL p. 1586 says if localPort is unspecified, bind to any port,
// i.e. '0' and if localAddr is unspecified, use getLocalAddress() as
// that default. JDK 1.2 doc infers not to do a bind.
1999-04-07 16:42:40 +02:00
}
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
// This has to be accessible from java.net.ServerSocket.
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
SocketImpl getImpl() throws SocketException
{
try
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
if (! implCreated)
{
impl.create(true);
implCreated = true;
}
}
catch (IOException e)
{
throw new SocketException(e.getMessage());
}
return impl;
}
/**
* Binds the socket to the givent local address/port
*
* @param bindpoint The address/port to bind to
*
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
* @exception IOException If an error occurs
* @exception SecurityException If a security manager exists and its
* checkConnect method doesn't allow the operation
* @exception IllegalArgumentException If the address type is not supported
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
*
* @since 1.4
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public void bind(SocketAddress bindpoint) throws IOException
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
// XXX: JDK 1.4.1 API documentation says that if bindpoint is null the
// socket will be bound to an ephemeral port and a valid local address.
if (bindpoint == null)
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
bindpoint = new InetSocketAddress(InetAddress.ANY_IF, 0);
if (! (bindpoint instanceof InetSocketAddress))
throw new IllegalArgumentException();
InetSocketAddress tmp = (InetSocketAddress) bindpoint;
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
// bind to address/port
try
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
getImpl().bind(tmp.getAddress(), tmp.getPort());
bound = true;
}
catch (IOException exception)
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
close();
throw exception;
}
catch (RuntimeException exception)
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
close();
throw exception;
}
catch (Error error)
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
close();
throw error;
}
}
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
/**
* Connects the socket with a remote address.
*
* @param endpoint The address to connect to
*
* @exception IOException If an error occurs
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
* @exception IllegalArgumentException If the addess type is not supported
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Initialize new instance variables. (close): Reset new instance variables. (getLocalAddress): Remove unneeded SecurityManager usage. (getLocalPort): Check if socket is already bound. (isConnected): New method. (getInetAddress): Implemented. (getPort): Better Implementation, documentation fixed. (getRemoteSocketAddress): New method. * java/net/JarURLConnection.java (element): Typo fixed. (getMainAttributes): New method. (getAttributes): New method (stub only). (getManifest): New method (stub only). * java/net/NetPermission.java: Added serialVersionsUID. * java/net/Socket.java (connect): Check blocking mode of associated channel, documentation added. (getLocalSocketAddress): Better implementation. (getRemoteSocketAddress): Implemented. (isBound): New method. (setSendBufferSize): Documentation added. * java/net/SocketAddress.java: Added serialVersionsUID. * java/net/SocketPermission.java: Added serialVersionsUID. * java/net/URL.java (URL): Wrap for shorter lines, initialize new instance variables, documentation added. (equals): Check new instance variables too. (getContent): Documentation added. (getPath): Documentation added. (getAuthority): New method. (getHost): Documentation added. (getPort): Documentation added. (getDefaultPort): New method. (getProtocol): Documentation added. (getUserInfo): Documentation added. (set): Initialize new instance variables, documentation added. * java/net/URLStreamHandler.java (setURL): New method. * java/net/natPlainDatagramSocketImpl.cc (connect): Fix exception name. (disconnect): Fix exception name. From-SVN: r57501
2002-09-25 19:14:09 +02:00
* @exception IllegalBlockingModeException If this socket has an associated
* channel, and the channel is in non-blocking mode
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
*
* @since 1.4
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public void connect(SocketAddress endpoint) throws IOException
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
connect(endpoint, 0);
}
/**
* Connects the socket with a remote address. A timeout of zero is
* interpreted as an infinite timeout. The connection will then block
* until established or an error occurs.
*
* @param endpoint The address to connect to
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* @param timeout The length of the timeout in milliseconds, or
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
* 0 to indicate no timeout.
*
* @exception IOException If an error occurs
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
* @exception IllegalArgumentException If the address type is not supported
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Initialize new instance variables. (close): Reset new instance variables. (getLocalAddress): Remove unneeded SecurityManager usage. (getLocalPort): Check if socket is already bound. (isConnected): New method. (getInetAddress): Implemented. (getPort): Better Implementation, documentation fixed. (getRemoteSocketAddress): New method. * java/net/JarURLConnection.java (element): Typo fixed. (getMainAttributes): New method. (getAttributes): New method (stub only). (getManifest): New method (stub only). * java/net/NetPermission.java: Added serialVersionsUID. * java/net/Socket.java (connect): Check blocking mode of associated channel, documentation added. (getLocalSocketAddress): Better implementation. (getRemoteSocketAddress): Implemented. (isBound): New method. (setSendBufferSize): Documentation added. * java/net/SocketAddress.java: Added serialVersionsUID. * java/net/SocketPermission.java: Added serialVersionsUID. * java/net/URL.java (URL): Wrap for shorter lines, initialize new instance variables, documentation added. (equals): Check new instance variables too. (getContent): Documentation added. (getPath): Documentation added. (getAuthority): New method. (getHost): Documentation added. (getPort): Documentation added. (getDefaultPort): New method. (getProtocol): Documentation added. (getUserInfo): Documentation added. (set): Initialize new instance variables, documentation added. * java/net/URLStreamHandler.java (setURL): New method. * java/net/natPlainDatagramSocketImpl.cc (connect): Fix exception name. (disconnect): Fix exception name. From-SVN: r57501
2002-09-25 19:14:09 +02:00
* @exception IllegalBlockingModeException If this socket has an associated
* channel, and the channel is in non-blocking mode
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
* @exception SocketTimeoutException If the timeout is reached
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
*
* @since 1.4
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public void connect(SocketAddress endpoint, int timeout)
throws IOException
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
if (! (endpoint instanceof InetSocketAddress))
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
throw new IllegalArgumentException("unsupported address type");
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
// The Sun spec says that if we have an associated channel and
// it is in non-blocking mode, we throw an IllegalBlockingModeException.
// However, in our implementation if the channel itself initiated this
// operation, then we must honor it regardless of its blocking mode.
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
if (getChannel() != null && ! getChannel().isBlocking()
&& ! ((PlainSocketImpl) getImpl()).isInChannelOperation())
throw new IllegalBlockingModeException();
if (! isBound())
bind(null);
try
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
getImpl().connect(endpoint, timeout);
}
catch (IOException exception)
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
close();
throw exception;
}
catch (RuntimeException exception)
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
close();
throw exception;
}
catch (Error error)
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
close();
throw error;
}
}
/**
* Returns the address of the remote end of the socket. If this socket
* is not connected, then <code>null</code> is returned.
*
* @return The remote address this socket is connected to
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public InetAddress getInetAddress()
1999-04-07 16:42:40 +02:00
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
if (! isConnected())
return null;
try
{
return getImpl().getInetAddress();
}
catch (SocketException e)
{
// This cannot happen as we are connected.
}
return null;
1999-04-07 16:42:40 +02:00
}
/**
* Returns the local address to which this socket is bound. If this socket
* is not connected, then <code>null</code> is returned.
*
* @return The local address
*
* @since 1.1
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public InetAddress getLocalAddress()
1999-04-07 16:42:40 +02:00
{
if (! isBound())
return null;
InetAddress addr = null;
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
[multiple changes] 1999-05-26 Bryce McKinlay <bryce@albatross.co.nz> * java/net/DatagramSocket.java (getSoTimeout): Verify class type. * java/net/DatagramSocketImpl.java (getOption): Made abstract. (setOption): Made abstract. * java/net/PlainDatagramSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/PlainSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/ServerSocket.java (toString): Prepended "ServerSocket". * java/net/Socket.java (getLocalAddress): Implemented. (setTcpNoDelay): Implemented. (getTcpNoDelay): Implemented. (setSoLinger): Implemented. (getSoLinger): Implemented. (getSoTimeout): Verify class type. (setSendBufferSize): Implemented. (getSendBufferSize): Implemented. (setReceiveBufferSize): Implemented. (getReceiveBufferSize): Implemented. (toString): Prepended "Socket". * java/net/SocketImpl.java (toString): Rewritten. (getOption): Made abstract. (setOption): Made abstract. * java/net/natPlainSocketImpl.cc (connect): Set localport properly. (setOption): Implemented. (getOption): Implemented. 1999-05-26 Warren Levy <warrenl@cygnus.com> * java/net/DatagramSocket.java (DatagramSocket): Get local host address when null. Set SO_REUSEADDR for multicasts. (getSoTimeout): Implemented. (setSoTimeout): Implemented. * java/net/DatagramSocketImpl.java: Implement SocketOptions interface. * java/net/MulticastSocket.java (getInterface): Implemented. (setInterface): Implemented. (setTimeToLive): Check for invalid ttl. (joinGroup): Verify multicast address and security. (leaveGroup): Verify multicast address and security. (send): Implemented. * java/net/PlainDatagramSocketImpl.java (timeout): Added. (iface): Added. (ttl): Added. (setOption): Added. (getOption): Added. (mcastGrp): Added. (getTTL): Implemented as non-native. (setTTL): ditto. (join): ditto. (leave): ditto. * java/net/ServerSocket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (setSocketFactory): Made synchronized. * java/net/Socket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (close): Made synchronized. (setSocketImplFactory): Made synchronized. * java/net/SocketImpl.java: Implement SocketOptions interface. * java/net/natInetAddress.cc: Corrected module name at top of file. * java/net/natPlainDatagramSocketImpl.cc (McastReq): Added union. (bind): Added FIXME. (peek): Implemented. (setTTL): Removed. (getTTL): Removed. (join): Removed. (leave): Removed. (mcastGrp): Added. (setOption): Implemented for SO_REUSEADDR. (getOption): Implemented for SO_REUSEADDR. From-SVN: r27184
1999-05-26 19:00:06 +02:00
try
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
addr = (InetAddress) getImpl().getOption(SocketOptions.SO_BINDADDR);
[multiple changes] 1999-05-26 Bryce McKinlay <bryce@albatross.co.nz> * java/net/DatagramSocket.java (getSoTimeout): Verify class type. * java/net/DatagramSocketImpl.java (getOption): Made abstract. (setOption): Made abstract. * java/net/PlainDatagramSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/PlainSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/ServerSocket.java (toString): Prepended "ServerSocket". * java/net/Socket.java (getLocalAddress): Implemented. (setTcpNoDelay): Implemented. (getTcpNoDelay): Implemented. (setSoLinger): Implemented. (getSoLinger): Implemented. (getSoTimeout): Verify class type. (setSendBufferSize): Implemented. (getSendBufferSize): Implemented. (setReceiveBufferSize): Implemented. (getReceiveBufferSize): Implemented. (toString): Prepended "Socket". * java/net/SocketImpl.java (toString): Rewritten. (getOption): Made abstract. (setOption): Made abstract. * java/net/natPlainSocketImpl.cc (connect): Set localport properly. (setOption): Implemented. (getOption): Implemented. 1999-05-26 Warren Levy <warrenl@cygnus.com> * java/net/DatagramSocket.java (DatagramSocket): Get local host address when null. Set SO_REUSEADDR for multicasts. (getSoTimeout): Implemented. (setSoTimeout): Implemented. * java/net/DatagramSocketImpl.java: Implement SocketOptions interface. * java/net/MulticastSocket.java (getInterface): Implemented. (setInterface): Implemented. (setTimeToLive): Check for invalid ttl. (joinGroup): Verify multicast address and security. (leaveGroup): Verify multicast address and security. (send): Implemented. * java/net/PlainDatagramSocketImpl.java (timeout): Added. (iface): Added. (ttl): Added. (setOption): Added. (getOption): Added. (mcastGrp): Added. (getTTL): Implemented as non-native. (setTTL): ditto. (join): ditto. (leave): ditto. * java/net/ServerSocket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (setSocketFactory): Made synchronized. * java/net/Socket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (close): Made synchronized. (setSocketImplFactory): Made synchronized. * java/net/SocketImpl.java: Implement SocketOptions interface. * java/net/natInetAddress.cc: Corrected module name at top of file. * java/net/natPlainDatagramSocketImpl.cc (McastReq): Added union. (bind): Added FIXME. (peek): Implemented. (setTTL): Removed. (getTTL): Removed. (join): Removed. (leave): Removed. (mcastGrp): Added. (setOption): Implemented for SO_REUSEADDR. (getOption): Implemented for SO_REUSEADDR. From-SVN: r27184
1999-05-26 19:00:06 +02:00
}
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
catch (SocketException e)
[multiple changes] 1999-05-26 Bryce McKinlay <bryce@albatross.co.nz> * java/net/DatagramSocket.java (getSoTimeout): Verify class type. * java/net/DatagramSocketImpl.java (getOption): Made abstract. (setOption): Made abstract. * java/net/PlainDatagramSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/PlainSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/ServerSocket.java (toString): Prepended "ServerSocket". * java/net/Socket.java (getLocalAddress): Implemented. (setTcpNoDelay): Implemented. (getTcpNoDelay): Implemented. (setSoLinger): Implemented. (getSoLinger): Implemented. (getSoTimeout): Verify class type. (setSendBufferSize): Implemented. (getSendBufferSize): Implemented. (setReceiveBufferSize): Implemented. (getReceiveBufferSize): Implemented. (toString): Prepended "Socket". * java/net/SocketImpl.java (toString): Rewritten. (getOption): Made abstract. (setOption): Made abstract. * java/net/natPlainSocketImpl.cc (connect): Set localport properly. (setOption): Implemented. (getOption): Implemented. 1999-05-26 Warren Levy <warrenl@cygnus.com> * java/net/DatagramSocket.java (DatagramSocket): Get local host address when null. Set SO_REUSEADDR for multicasts. (getSoTimeout): Implemented. (setSoTimeout): Implemented. * java/net/DatagramSocketImpl.java: Implement SocketOptions interface. * java/net/MulticastSocket.java (getInterface): Implemented. (setInterface): Implemented. (setTimeToLive): Check for invalid ttl. (joinGroup): Verify multicast address and security. (leaveGroup): Verify multicast address and security. (send): Implemented. * java/net/PlainDatagramSocketImpl.java (timeout): Added. (iface): Added. (ttl): Added. (setOption): Added. (getOption): Added. (mcastGrp): Added. (getTTL): Implemented as non-native. (setTTL): ditto. (join): ditto. (leave): ditto. * java/net/ServerSocket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (setSocketFactory): Made synchronized. * java/net/Socket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (close): Made synchronized. (setSocketImplFactory): Made synchronized. * java/net/SocketImpl.java: Implement SocketOptions interface. * java/net/natInetAddress.cc: Corrected module name at top of file. * java/net/natPlainDatagramSocketImpl.cc (McastReq): Added union. (bind): Added FIXME. (peek): Implemented. (setTTL): Removed. (getTTL): Removed. (join): Removed. (leave): Removed. (mcastGrp): Added. (setOption): Implemented for SO_REUSEADDR. (getOption): Implemented for SO_REUSEADDR. From-SVN: r27184
1999-05-26 19:00:06 +02:00
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
// (hopefully) shouldn't happen
// throw new java.lang.InternalError
// ("Error in PlainSocketImpl.getOption");
return null;
[multiple changes] 1999-05-26 Bryce McKinlay <bryce@albatross.co.nz> * java/net/DatagramSocket.java (getSoTimeout): Verify class type. * java/net/DatagramSocketImpl.java (getOption): Made abstract. (setOption): Made abstract. * java/net/PlainDatagramSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/PlainSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/ServerSocket.java (toString): Prepended "ServerSocket". * java/net/Socket.java (getLocalAddress): Implemented. (setTcpNoDelay): Implemented. (getTcpNoDelay): Implemented. (setSoLinger): Implemented. (getSoLinger): Implemented. (getSoTimeout): Verify class type. (setSendBufferSize): Implemented. (getSendBufferSize): Implemented. (setReceiveBufferSize): Implemented. (getReceiveBufferSize): Implemented. (toString): Prepended "Socket". * java/net/SocketImpl.java (toString): Rewritten. (getOption): Made abstract. (setOption): Made abstract. * java/net/natPlainSocketImpl.cc (connect): Set localport properly. (setOption): Implemented. (getOption): Implemented. 1999-05-26 Warren Levy <warrenl@cygnus.com> * java/net/DatagramSocket.java (DatagramSocket): Get local host address when null. Set SO_REUSEADDR for multicasts. (getSoTimeout): Implemented. (setSoTimeout): Implemented. * java/net/DatagramSocketImpl.java: Implement SocketOptions interface. * java/net/MulticastSocket.java (getInterface): Implemented. (setInterface): Implemented. (setTimeToLive): Check for invalid ttl. (joinGroup): Verify multicast address and security. (leaveGroup): Verify multicast address and security. (send): Implemented. * java/net/PlainDatagramSocketImpl.java (timeout): Added. (iface): Added. (ttl): Added. (setOption): Added. (getOption): Added. (mcastGrp): Added. (getTTL): Implemented as non-native. (setTTL): ditto. (join): ditto. (leave): ditto. * java/net/ServerSocket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (setSocketFactory): Made synchronized. * java/net/Socket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (close): Made synchronized. (setSocketImplFactory): Made synchronized. * java/net/SocketImpl.java: Implement SocketOptions interface. * java/net/natInetAddress.cc: Corrected module name at top of file. * java/net/natPlainDatagramSocketImpl.cc (McastReq): Added union. (bind): Added FIXME. (peek): Implemented. (setTTL): Removed. (getTTL): Removed. (join): Removed. (leave): Removed. (mcastGrp): Added. (setOption): Implemented for SO_REUSEADDR. (getOption): Implemented for SO_REUSEADDR. From-SVN: r27184
1999-05-26 19:00:06 +02:00
}
// FIXME: According to libgcj, checkConnect() is supposed to be called
// before performing this operation. Problems: 1) We don't have the
// addr until after we do it, so we do a post check. 2). The docs I
// see don't require this in the Socket case, only DatagramSocket, but
// we'll assume they mean both.
SecurityManager sm = System.getSecurityManager();
if (sm != null)
sm.checkConnect(addr.getHostName(), getLocalPort());
return addr;
1999-04-07 16:42:40 +02:00
}
/**
* Returns the port number of the remote end of the socket connection. If
* this socket is not connected, then -1 is returned.
*
* @return The remote port this socket is connected to
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public int getPort()
1999-04-07 16:42:40 +02:00
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
if (! isConnected())
return -1;
try
{
return getImpl().getPort();
}
catch (SocketException e)
{
// This cannot happen as we are connected.
}
return -1;
1999-04-07 16:42:40 +02:00
}
/**
* Returns the local port number to which this socket is bound. If this
* socket is not connected, then -1 is returned.
*
* @return The local port
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public int getLocalPort()
1999-04-07 16:42:40 +02:00
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
if (! isBound())
return -1;
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
try
{
if (getImpl() != null)
return getImpl().getLocalPort();
}
catch (SocketException e)
{
// This cannot happen as we are bound.
}
return -1;
1999-04-07 16:42:40 +02:00
}
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
/**
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* Returns local socket address.
*
* @return the local socket address, null if not bound
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
*
* @since 1.4
*/
public SocketAddress getLocalSocketAddress()
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
if (! isBound())
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Initialize new instance variables. (close): Reset new instance variables. (getLocalAddress): Remove unneeded SecurityManager usage. (getLocalPort): Check if socket is already bound. (isConnected): New method. (getInetAddress): Implemented. (getPort): Better Implementation, documentation fixed. (getRemoteSocketAddress): New method. * java/net/JarURLConnection.java (element): Typo fixed. (getMainAttributes): New method. (getAttributes): New method (stub only). (getManifest): New method (stub only). * java/net/NetPermission.java: Added serialVersionsUID. * java/net/Socket.java (connect): Check blocking mode of associated channel, documentation added. (getLocalSocketAddress): Better implementation. (getRemoteSocketAddress): Implemented. (isBound): New method. (setSendBufferSize): Documentation added. * java/net/SocketAddress.java: Added serialVersionsUID. * java/net/SocketPermission.java: Added serialVersionsUID. * java/net/URL.java (URL): Wrap for shorter lines, initialize new instance variables, documentation added. (equals): Check new instance variables too. (getContent): Documentation added. (getPath): Documentation added. (getAuthority): New method. (getHost): Documentation added. (getPort): Documentation added. (getDefaultPort): New method. (getProtocol): Documentation added. (getUserInfo): Documentation added. (set): Initialize new instance variables, documentation added. * java/net/URLStreamHandler.java (setURL): New method. * java/net/natPlainDatagramSocketImpl.cc (connect): Fix exception name. (disconnect): Fix exception name. From-SVN: r57501
2002-09-25 19:14:09 +02:00
return null;
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
InetAddress addr = getLocalAddress();
try
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
return new InetSocketAddress(addr, getImpl().getLocalPort());
}
catch (SocketException e)
{
// This cannot happen as we are bound.
return null;
}
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
}
/**
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* Returns the remote socket address.
*
* @return the remote socket address, null of not connected
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
*
* @since 1.4
*/
public SocketAddress getRemoteSocketAddress()
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
if (! isConnected())
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
return null;
try
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
return new InetSocketAddress(getImpl().getInetAddress(),
getImpl().getPort());
}
catch (SocketException e)
{
// This cannot happen as we are connected.
return null;
}
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
}
/**
* Returns an InputStream for reading from this socket.
*
* @return The InputStream object
*
* @exception IOException If an error occurs or Socket is not connected
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public InputStream getInputStream() throws IOException
1999-04-07 16:42:40 +02:00
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
if (! isConnected())
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
throw new IOException("not connected");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
return getImpl().getInputStream();
1999-04-07 16:42:40 +02:00
}
/**
* Returns an OutputStream for writing to this socket.
*
* @return The OutputStream object
*
* @exception IOException If an error occurs or Socket is not connected
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public OutputStream getOutputStream() throws IOException
1999-04-07 16:42:40 +02:00
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
if (! isConnected())
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
throw new IOException("not connected");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
return getImpl().getOutputStream();
1999-04-07 16:42:40 +02:00
}
/**
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* Sets the TCP_NODELAY option on the socket.
*
* @param on true to enable, false to disable
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
*
* @exception SocketException If an error occurs or Socket is not connected
*
* @since 1.1
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public void setTcpNoDelay(boolean on) throws SocketException
1999-04-07 16:42:40 +02:00
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
getImpl().setOption(SocketOptions.TCP_NODELAY, Boolean.valueOf(on));
1999-04-07 16:42:40 +02:00
}
/**
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* Tests whether or not the TCP_NODELAY option is set on the socket.
* Returns true if enabled, false if disabled. When on it disables the
* Nagle algorithm which means that packets are always send immediatly and
* never merged together to reduce network trafic.
*
* @return Whether or not TCP_NODELAY is set
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
*
* @exception SocketException If an error occurs or Socket not connected
*
* @since 1.1
*/
1999-04-07 16:42:40 +02:00
public boolean getTcpNoDelay() throws SocketException
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
Object on = getImpl().getOption(SocketOptions.TCP_NODELAY);
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
if (on instanceof Boolean)
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
return (((Boolean) on).booleanValue());
else
throw new SocketException("Internal Error");
1999-04-07 16:42:40 +02:00
}
/**
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* Sets the value of the SO_LINGER option on the socket. If the
* SO_LINGER option is set on a socket and there is still data waiting to
* be sent when the socket is closed, then the close operation will block
* until either that data is delivered or until the timeout period
* expires. The linger interval is specified in hundreths of a second
* (platform specific?)
*
* @param on true to enable SO_LINGER, false to disable
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* @param linger The SO_LINGER timeout in hundreths of a second or -1 if
* SO_LINGER not set.
*
* @exception SocketException If an error occurs or Socket not connected
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
* @exception IllegalArgumentException If linger is negative
*
* @since 1.1
*/
1999-04-07 16:42:40 +02:00
public void setSoLinger(boolean on, int linger) throws SocketException
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
if (on)
[multiple changes] 1999-05-26 Bryce McKinlay <bryce@albatross.co.nz> * java/net/DatagramSocket.java (getSoTimeout): Verify class type. * java/net/DatagramSocketImpl.java (getOption): Made abstract. (setOption): Made abstract. * java/net/PlainDatagramSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/PlainSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/ServerSocket.java (toString): Prepended "ServerSocket". * java/net/Socket.java (getLocalAddress): Implemented. (setTcpNoDelay): Implemented. (getTcpNoDelay): Implemented. (setSoLinger): Implemented. (getSoLinger): Implemented. (getSoTimeout): Verify class type. (setSendBufferSize): Implemented. (getSendBufferSize): Implemented. (setReceiveBufferSize): Implemented. (getReceiveBufferSize): Implemented. (toString): Prepended "Socket". * java/net/SocketImpl.java (toString): Rewritten. (getOption): Made abstract. (setOption): Made abstract. * java/net/natPlainSocketImpl.cc (connect): Set localport properly. (setOption): Implemented. (getOption): Implemented. 1999-05-26 Warren Levy <warrenl@cygnus.com> * java/net/DatagramSocket.java (DatagramSocket): Get local host address when null. Set SO_REUSEADDR for multicasts. (getSoTimeout): Implemented. (setSoTimeout): Implemented. * java/net/DatagramSocketImpl.java: Implement SocketOptions interface. * java/net/MulticastSocket.java (getInterface): Implemented. (setInterface): Implemented. (setTimeToLive): Check for invalid ttl. (joinGroup): Verify multicast address and security. (leaveGroup): Verify multicast address and security. (send): Implemented. * java/net/PlainDatagramSocketImpl.java (timeout): Added. (iface): Added. (ttl): Added. (setOption): Added. (getOption): Added. (mcastGrp): Added. (getTTL): Implemented as non-native. (setTTL): ditto. (join): ditto. (leave): ditto. * java/net/ServerSocket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (setSocketFactory): Made synchronized. * java/net/Socket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (close): Made synchronized. (setSocketImplFactory): Made synchronized. * java/net/SocketImpl.java: Implement SocketOptions interface. * java/net/natInetAddress.cc: Corrected module name at top of file. * java/net/natPlainDatagramSocketImpl.cc (McastReq): Added union. (bind): Added FIXME. (peek): Implemented. (setTTL): Removed. (getTTL): Removed. (join): Removed. (leave): Removed. (mcastGrp): Added. (setOption): Implemented for SO_REUSEADDR. (getOption): Implemented for SO_REUSEADDR. From-SVN: r27184
1999-05-26 19:00:06 +02:00
{
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
if (linger < 0)
throw new IllegalArgumentException("SO_LINGER must be >= 0");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
if (linger > 65535)
linger = 65535;
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
getImpl().setOption(SocketOptions.SO_LINGER, new Integer(linger));
}
[multiple changes] 1999-05-26 Bryce McKinlay <bryce@albatross.co.nz> * java/net/DatagramSocket.java (getSoTimeout): Verify class type. * java/net/DatagramSocketImpl.java (getOption): Made abstract. (setOption): Made abstract. * java/net/PlainDatagramSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/PlainSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/ServerSocket.java (toString): Prepended "ServerSocket". * java/net/Socket.java (getLocalAddress): Implemented. (setTcpNoDelay): Implemented. (getTcpNoDelay): Implemented. (setSoLinger): Implemented. (getSoLinger): Implemented. (getSoTimeout): Verify class type. (setSendBufferSize): Implemented. (getSendBufferSize): Implemented. (setReceiveBufferSize): Implemented. (getReceiveBufferSize): Implemented. (toString): Prepended "Socket". * java/net/SocketImpl.java (toString): Rewritten. (getOption): Made abstract. (setOption): Made abstract. * java/net/natPlainSocketImpl.cc (connect): Set localport properly. (setOption): Implemented. (getOption): Implemented. 1999-05-26 Warren Levy <warrenl@cygnus.com> * java/net/DatagramSocket.java (DatagramSocket): Get local host address when null. Set SO_REUSEADDR for multicasts. (getSoTimeout): Implemented. (setSoTimeout): Implemented. * java/net/DatagramSocketImpl.java: Implement SocketOptions interface. * java/net/MulticastSocket.java (getInterface): Implemented. (setInterface): Implemented. (setTimeToLive): Check for invalid ttl. (joinGroup): Verify multicast address and security. (leaveGroup): Verify multicast address and security. (send): Implemented. * java/net/PlainDatagramSocketImpl.java (timeout): Added. (iface): Added. (ttl): Added. (setOption): Added. (getOption): Added. (mcastGrp): Added. (getTTL): Implemented as non-native. (setTTL): ditto. (join): ditto. (leave): ditto. * java/net/ServerSocket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (setSocketFactory): Made synchronized. * java/net/Socket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (close): Made synchronized. (setSocketImplFactory): Made synchronized. * java/net/SocketImpl.java: Implement SocketOptions interface. * java/net/natInetAddress.cc: Corrected module name at top of file. * java/net/natPlainDatagramSocketImpl.cc (McastReq): Added union. (bind): Added FIXME. (peek): Implemented. (setTTL): Removed. (getTTL): Removed. (join): Removed. (leave): Removed. (mcastGrp): Added. (setOption): Implemented for SO_REUSEADDR. (getOption): Implemented for SO_REUSEADDR. From-SVN: r27184
1999-05-26 19:00:06 +02:00
else
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
getImpl().setOption(SocketOptions.SO_LINGER, Boolean.valueOf(false));
1999-04-07 16:42:40 +02:00
}
/**
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* Returns the value of the SO_LINGER option on the socket. If the
* SO_LINGER option is set on a socket and there is still data waiting to
* be sent when the socket is closed, then the close operation will block
* until either that data is delivered or until the timeout period
* expires. This method either returns the timeouts (in hundredths of
* of a second (platform specific?)) if SO_LINGER is set, or -1 if
* SO_LINGER is not set.
*
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* @return The SO_LINGER timeout in hundreths of a second or -1
* if SO_LINGER not set
*
* @exception SocketException If an error occurs or Socket is not connected
*
* @since 1.1
*/
public int getSoLinger() throws SocketException
1999-04-07 16:42:40 +02:00
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
Object linger = getImpl().getOption(SocketOptions.SO_LINGER);
if (linger instanceof Integer)
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
return (((Integer) linger).intValue());
[multiple changes] 1999-05-26 Bryce McKinlay <bryce@albatross.co.nz> * java/net/DatagramSocket.java (getSoTimeout): Verify class type. * java/net/DatagramSocketImpl.java (getOption): Made abstract. (setOption): Made abstract. * java/net/PlainDatagramSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/PlainSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/ServerSocket.java (toString): Prepended "ServerSocket". * java/net/Socket.java (getLocalAddress): Implemented. (setTcpNoDelay): Implemented. (getTcpNoDelay): Implemented. (setSoLinger): Implemented. (getSoLinger): Implemented. (getSoTimeout): Verify class type. (setSendBufferSize): Implemented. (getSendBufferSize): Implemented. (setReceiveBufferSize): Implemented. (getReceiveBufferSize): Implemented. (toString): Prepended "Socket". * java/net/SocketImpl.java (toString): Rewritten. (getOption): Made abstract. (setOption): Made abstract. * java/net/natPlainSocketImpl.cc (connect): Set localport properly. (setOption): Implemented. (getOption): Implemented. 1999-05-26 Warren Levy <warrenl@cygnus.com> * java/net/DatagramSocket.java (DatagramSocket): Get local host address when null. Set SO_REUSEADDR for multicasts. (getSoTimeout): Implemented. (setSoTimeout): Implemented. * java/net/DatagramSocketImpl.java: Implement SocketOptions interface. * java/net/MulticastSocket.java (getInterface): Implemented. (setInterface): Implemented. (setTimeToLive): Check for invalid ttl. (joinGroup): Verify multicast address and security. (leaveGroup): Verify multicast address and security. (send): Implemented. * java/net/PlainDatagramSocketImpl.java (timeout): Added. (iface): Added. (ttl): Added. (setOption): Added. (getOption): Added. (mcastGrp): Added. (getTTL): Implemented as non-native. (setTTL): ditto. (join): ditto. (leave): ditto. * java/net/ServerSocket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (setSocketFactory): Made synchronized. * java/net/Socket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (close): Made synchronized. (setSocketImplFactory): Made synchronized. * java/net/SocketImpl.java: Implement SocketOptions interface. * java/net/natInetAddress.cc: Corrected module name at top of file. * java/net/natPlainDatagramSocketImpl.cc (McastReq): Added union. (bind): Added FIXME. (peek): Implemented. (setTTL): Removed. (getTTL): Removed. (join): Removed. (leave): Removed. (mcastGrp): Added. (setOption): Implemented for SO_REUSEADDR. (getOption): Implemented for SO_REUSEADDR. From-SVN: r27184
1999-05-26 19:00:06 +02:00
else
return -1;
1999-04-07 16:42:40 +02:00
}
/**
* Sends urgent data through the socket
*
* @param data The data to send.
* Only the lowest eight bits of data are sent
*
* @exception IOException If an error occurs
*
* @since 1.4
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public void sendUrgentData(int data) throws IOException
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
getImpl().sendUrgentData(data);
}
/**
* Enables/disables the SO_OOBINLINE option
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
*
* @param on True if SO_OOBLINE should be enabled
*
* @exception SocketException If an error occurs
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
*
* @since 1.4
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public void setOOBInline(boolean on) throws SocketException
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
getImpl().setOption(SocketOptions.SO_OOBINLINE, Boolean.valueOf(on));
}
/**
* Returns the current setting of the SO_OOBINLINE option for this socket
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
*
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
* @return True if SO_OOBINLINE is set, false otherwise.
*
* @exception SocketException If an error occurs
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
*
* @since 1.4
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public boolean getOOBInline() throws SocketException
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
Object buf = getImpl().getOption(SocketOptions.SO_OOBINLINE);
if (buf instanceof Boolean)
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
return (((Boolean) buf).booleanValue());
else
throw new SocketException("Internal Error: Unexpected type");
}
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
/**
* Sets the value of the SO_TIMEOUT option on the socket. If this value
* is set, and an read/write is performed that does not complete within
* the timeout period, a short count is returned (or an EWOULDBLOCK signal
* would be sent in Unix if no data had been read). A value of 0 for
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* this option implies that there is no timeout (ie, operations will
* block forever). On systems that have separate read and write timeout
* values, this method returns the read timeout. This
* value is in milliseconds.
*
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* @param timeout The length of the timeout in milliseconds, or
* 0 to indicate no timeout.
*
* @exception SocketException If an error occurs or Socket not connected
*
* @since 1.1
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public synchronized void setSoTimeout(int timeout) throws SocketException
1999-04-07 16:42:40 +02:00
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
[multiple changes] 1999-05-26 Bryce McKinlay <bryce@albatross.co.nz> * java/net/DatagramSocket.java (getSoTimeout): Verify class type. * java/net/DatagramSocketImpl.java (getOption): Made abstract. (setOption): Made abstract. * java/net/PlainDatagramSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/PlainSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/ServerSocket.java (toString): Prepended "ServerSocket". * java/net/Socket.java (getLocalAddress): Implemented. (setTcpNoDelay): Implemented. (getTcpNoDelay): Implemented. (setSoLinger): Implemented. (getSoLinger): Implemented. (getSoTimeout): Verify class type. (setSendBufferSize): Implemented. (getSendBufferSize): Implemented. (setReceiveBufferSize): Implemented. (getReceiveBufferSize): Implemented. (toString): Prepended "Socket". * java/net/SocketImpl.java (toString): Rewritten. (getOption): Made abstract. (setOption): Made abstract. * java/net/natPlainSocketImpl.cc (connect): Set localport properly. (setOption): Implemented. (getOption): Implemented. 1999-05-26 Warren Levy <warrenl@cygnus.com> * java/net/DatagramSocket.java (DatagramSocket): Get local host address when null. Set SO_REUSEADDR for multicasts. (getSoTimeout): Implemented. (setSoTimeout): Implemented. * java/net/DatagramSocketImpl.java: Implement SocketOptions interface. * java/net/MulticastSocket.java (getInterface): Implemented. (setInterface): Implemented. (setTimeToLive): Check for invalid ttl. (joinGroup): Verify multicast address and security. (leaveGroup): Verify multicast address and security. (send): Implemented. * java/net/PlainDatagramSocketImpl.java (timeout): Added. (iface): Added. (ttl): Added. (setOption): Added. (getOption): Added. (mcastGrp): Added. (getTTL): Implemented as non-native. (setTTL): ditto. (join): ditto. (leave): ditto. * java/net/ServerSocket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (setSocketFactory): Made synchronized. * java/net/Socket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (close): Made synchronized. (setSocketImplFactory): Made synchronized. * java/net/SocketImpl.java: Implement SocketOptions interface. * java/net/natInetAddress.cc: Corrected module name at top of file. * java/net/natPlainDatagramSocketImpl.cc (McastReq): Added union. (bind): Added FIXME. (peek): Implemented. (setTTL): Removed. (getTTL): Removed. (join): Removed. (leave): Removed. (mcastGrp): Added. (setOption): Implemented for SO_REUSEADDR. (getOption): Implemented for SO_REUSEADDR. From-SVN: r27184
1999-05-26 19:00:06 +02:00
if (timeout < 0)
throw new IllegalArgumentException("SO_TIMEOUT value must be >= 0");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
getImpl().setOption(SocketOptions.SO_TIMEOUT, new Integer(timeout));
1999-04-07 16:42:40 +02:00
}
/**
* Returns the value of the SO_TIMEOUT option on the socket. If this value
* is set, and an read/write is performed that does not complete within
* the timeout period, a short count is returned (or an EWOULDBLOCK signal
* would be sent in Unix if no data had been read). A value of 0 for
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* this option implies that there is no timeout (ie, operations will
* block forever). On systems that have separate read and write timeout
* values, this method returns the read timeout. This
* value is in thousandths of a second (implementation specific?).
*
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* @return The length of the timeout in thousandth's of a second or 0
* if not set
*
* @exception SocketException If an error occurs or Socket not connected
*
* @since 1.1
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public synchronized int getSoTimeout() throws SocketException
1999-04-07 16:42:40 +02:00
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
Object timeout = getImpl().getOption(SocketOptions.SO_TIMEOUT);
if (timeout instanceof Integer)
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
return (((Integer) timeout).intValue());
[multiple changes] 1999-05-26 Bryce McKinlay <bryce@albatross.co.nz> * java/net/DatagramSocket.java (getSoTimeout): Verify class type. * java/net/DatagramSocketImpl.java (getOption): Made abstract. (setOption): Made abstract. * java/net/PlainDatagramSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/PlainSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/ServerSocket.java (toString): Prepended "ServerSocket". * java/net/Socket.java (getLocalAddress): Implemented. (setTcpNoDelay): Implemented. (getTcpNoDelay): Implemented. (setSoLinger): Implemented. (getSoLinger): Implemented. (getSoTimeout): Verify class type. (setSendBufferSize): Implemented. (getSendBufferSize): Implemented. (setReceiveBufferSize): Implemented. (getReceiveBufferSize): Implemented. (toString): Prepended "Socket". * java/net/SocketImpl.java (toString): Rewritten. (getOption): Made abstract. (setOption): Made abstract. * java/net/natPlainSocketImpl.cc (connect): Set localport properly. (setOption): Implemented. (getOption): Implemented. 1999-05-26 Warren Levy <warrenl@cygnus.com> * java/net/DatagramSocket.java (DatagramSocket): Get local host address when null. Set SO_REUSEADDR for multicasts. (getSoTimeout): Implemented. (setSoTimeout): Implemented. * java/net/DatagramSocketImpl.java: Implement SocketOptions interface. * java/net/MulticastSocket.java (getInterface): Implemented. (setInterface): Implemented. (setTimeToLive): Check for invalid ttl. (joinGroup): Verify multicast address and security. (leaveGroup): Verify multicast address and security. (send): Implemented. * java/net/PlainDatagramSocketImpl.java (timeout): Added. (iface): Added. (ttl): Added. (setOption): Added. (getOption): Added. (mcastGrp): Added. (getTTL): Implemented as non-native. (setTTL): ditto. (join): ditto. (leave): ditto. * java/net/ServerSocket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (setSocketFactory): Made synchronized. * java/net/Socket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (close): Made synchronized. (setSocketImplFactory): Made synchronized. * java/net/SocketImpl.java: Implement SocketOptions interface. * java/net/natInetAddress.cc: Corrected module name at top of file. * java/net/natPlainDatagramSocketImpl.cc (McastReq): Added union. (bind): Added FIXME. (peek): Implemented. (setTTL): Removed. (getTTL): Removed. (join): Removed. (leave): Removed. (mcastGrp): Added. (setOption): Implemented for SO_REUSEADDR. (getOption): Implemented for SO_REUSEADDR. From-SVN: r27184
1999-05-26 19:00:06 +02:00
else
return 0;
1999-04-07 16:42:40 +02:00
}
/**
* This method sets the value for the system level socket option
* SO_SNDBUF to the specified value. Note that valid values for this
* option are specific to a given operating system.
*
* @param size The new send buffer size.
*
* @exception SocketException If an error occurs or Socket not connected
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Initialize new instance variables. (close): Reset new instance variables. (getLocalAddress): Remove unneeded SecurityManager usage. (getLocalPort): Check if socket is already bound. (isConnected): New method. (getInetAddress): Implemented. (getPort): Better Implementation, documentation fixed. (getRemoteSocketAddress): New method. * java/net/JarURLConnection.java (element): Typo fixed. (getMainAttributes): New method. (getAttributes): New method (stub only). (getManifest): New method (stub only). * java/net/NetPermission.java: Added serialVersionsUID. * java/net/Socket.java (connect): Check blocking mode of associated channel, documentation added. (getLocalSocketAddress): Better implementation. (getRemoteSocketAddress): Implemented. (isBound): New method. (setSendBufferSize): Documentation added. * java/net/SocketAddress.java: Added serialVersionsUID. * java/net/SocketPermission.java: Added serialVersionsUID. * java/net/URL.java (URL): Wrap for shorter lines, initialize new instance variables, documentation added. (equals): Check new instance variables too. (getContent): Documentation added. (getPath): Documentation added. (getAuthority): New method. (getHost): Documentation added. (getPort): Documentation added. (getDefaultPort): New method. (getProtocol): Documentation added. (getUserInfo): Documentation added. (set): Initialize new instance variables, documentation added. * java/net/URLStreamHandler.java (setURL): New method. * java/net/natPlainDatagramSocketImpl.cc (connect): Fix exception name. (disconnect): Fix exception name. From-SVN: r57501
2002-09-25 19:14:09 +02:00
* @exception IllegalArgumentException If size is 0 or negative
*
* @since 1.2
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public void setSendBufferSize(int size) throws SocketException
1999-04-07 16:42:40 +02:00
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
[multiple changes] 1999-05-26 Bryce McKinlay <bryce@albatross.co.nz> * java/net/DatagramSocket.java (getSoTimeout): Verify class type. * java/net/DatagramSocketImpl.java (getOption): Made abstract. (setOption): Made abstract. * java/net/PlainDatagramSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/PlainSocketImpl.java: Mirror SocketOptions fields to avoid cpp conflicts in native code. * java/net/ServerSocket.java (toString): Prepended "ServerSocket". * java/net/Socket.java (getLocalAddress): Implemented. (setTcpNoDelay): Implemented. (getTcpNoDelay): Implemented. (setSoLinger): Implemented. (getSoLinger): Implemented. (getSoTimeout): Verify class type. (setSendBufferSize): Implemented. (getSendBufferSize): Implemented. (setReceiveBufferSize): Implemented. (getReceiveBufferSize): Implemented. (toString): Prepended "Socket". * java/net/SocketImpl.java (toString): Rewritten. (getOption): Made abstract. (setOption): Made abstract. * java/net/natPlainSocketImpl.cc (connect): Set localport properly. (setOption): Implemented. (getOption): Implemented. 1999-05-26 Warren Levy <warrenl@cygnus.com> * java/net/DatagramSocket.java (DatagramSocket): Get local host address when null. Set SO_REUSEADDR for multicasts. (getSoTimeout): Implemented. (setSoTimeout): Implemented. * java/net/DatagramSocketImpl.java: Implement SocketOptions interface. * java/net/MulticastSocket.java (getInterface): Implemented. (setInterface): Implemented. (setTimeToLive): Check for invalid ttl. (joinGroup): Verify multicast address and security. (leaveGroup): Verify multicast address and security. (send): Implemented. * java/net/PlainDatagramSocketImpl.java (timeout): Added. (iface): Added. (ttl): Added. (setOption): Added. (getOption): Added. (mcastGrp): Added. (getTTL): Implemented as non-native. (setTTL): ditto. (join): ditto. (leave): ditto. * java/net/ServerSocket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (setSocketFactory): Made synchronized. * java/net/Socket.java (setSoTimeout): Implemented. (getSoTimeout): Implemented. (close): Made synchronized. (setSocketImplFactory): Made synchronized. * java/net/SocketImpl.java: Implement SocketOptions interface. * java/net/natInetAddress.cc: Corrected module name at top of file. * java/net/natPlainDatagramSocketImpl.cc (McastReq): Added union. (bind): Added FIXME. (peek): Implemented. (setTTL): Removed. (getTTL): Removed. (join): Removed. (leave): Removed. (mcastGrp): Added. (setOption): Implemented for SO_REUSEADDR. (getOption): Implemented for SO_REUSEADDR. From-SVN: r27184
1999-05-26 19:00:06 +02:00
if (size <= 0)
throw new IllegalArgumentException("SO_SNDBUF value must be > 0");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
getImpl().setOption(SocketOptions.SO_SNDBUF, new Integer(size));
1999-04-07 16:42:40 +02:00
}
/**
* This method returns the value of the system level socket option
* SO_SNDBUF, which is used by the operating system to tune buffer
* sizes for data transfers.
*
* @return The send buffer size.
*
* @exception SocketException If an error occurs or socket not connected
*
* @since 1.2
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public int getSendBufferSize() throws SocketException
1999-04-07 16:42:40 +02:00
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
Object buf = getImpl().getOption(SocketOptions.SO_SNDBUF);
if (buf instanceof Integer)
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
return (((Integer) buf).intValue());
else
throw new SocketException("Internal Error: Unexpected type");
1999-04-07 16:42:40 +02:00
}
/**
* This method sets the value for the system level socket option
* SO_RCVBUF to the specified value. Note that valid values for this
* option are specific to a given operating system.
*
* @param size The new receive buffer size.
*
* @exception SocketException If an error occurs or Socket is not connected
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
* @exception IllegalArgumentException If size is 0 or negative
*
* @since 1.2
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public void setReceiveBufferSize(int size) throws SocketException
1999-04-07 16:42:40 +02:00
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
if (size <= 0)
throw new IllegalArgumentException("SO_RCVBUF value must be > 0");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
getImpl().setOption(SocketOptions.SO_RCVBUF, new Integer(size));
1999-04-07 16:42:40 +02:00
}
/**
* This method returns the value of the system level socket option
* SO_RCVBUF, which is used by the operating system to tune buffer
* sizes for data transfers.
*
* @return The receive buffer size.
*
* @exception SocketException If an error occurs or Socket is not connected
*
* @since 1.2
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public int getReceiveBufferSize() throws SocketException
1999-04-07 16:42:40 +02:00
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
Object buf = getImpl().getOption(SocketOptions.SO_RCVBUF);
if (buf instanceof Integer)
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
return (((Integer) buf).intValue());
else
throw new SocketException("Internal Error: Unexpected type");
1999-04-07 16:42:40 +02:00
}
/**
* This method sets the value for the socket level socket option
* SO_KEEPALIVE.
*
* @param on True if SO_KEEPALIVE should be enabled
*
* @exception SocketException If an error occurs or Socket is not connected
*
* @since 1.3
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public void setKeepAlive(boolean on) throws SocketException
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
getImpl().setOption(SocketOptions.SO_KEEPALIVE, Boolean.valueOf(on));
}
/**
* This method returns the value of the socket level socket option
* SO_KEEPALIVE.
*
* @return The setting
*
* @exception SocketException If an error occurs or Socket is not connected
*
* @since 1.3
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public boolean getKeepAlive() throws SocketException
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
Object buf = getImpl().getOption(SocketOptions.SO_KEEPALIVE);
if (buf instanceof Boolean)
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
return (((Boolean) buf).booleanValue());
else
throw new SocketException("Internal Error: Unexpected type");
}
/**
* Closes the socket.
*
* @exception IOException If an error occurs
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public synchronized void close() throws IOException
1999-04-07 16:42:40 +02:00
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
return;
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
getImpl().close();
impl = null;
bound = false;
if (getChannel() != null)
getChannel().close();
1999-04-07 16:42:40 +02:00
}
/**
* Converts this <code>Socket</code> to a <code>String</code>.
*
* @return The <code>String</code> representation of this <code>Socket</code>
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public String toString()
1999-04-07 16:42:40 +02:00
{
try
{
if (isConnected())
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
return ("Socket[addr=" + getImpl().getInetAddress() + ",port="
+ getImpl().getPort() + ",localport="
+ getImpl().getLocalPort() + "]");
}
catch (SocketException e)
{
// This cannot happen as we are connected.
}
return "Socket[unconnected]";
1999-04-07 16:42:40 +02:00
}
/**
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* Sets the <code>SocketImplFactory</code>. This may be done only once per
* virtual machine. Subsequent attempts will generate a
* <code>SocketException</code>. Note that a <code>SecurityManager</code>
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* check is made prior to setting the factory. If
* insufficient privileges exist to set the factory, then an
* <code>IOException</code> will be thrown.
*
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* @param fac the factory to set
*
* @exception SecurityException If the <code>SecurityManager</code> does
* not allow this operation.
* @exception SocketException If the SocketImplFactory is already defined
* @exception IOException If any other error occurs
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public static synchronized void setSocketImplFactory(SocketImplFactory fac)
1999-04-07 16:42:40 +02:00
throws IOException
{
// See if already set
if (factory != null)
throw new SocketException("SocketImplFactory already defined");
// Check permissions
SecurityManager sm = System.getSecurityManager();
if (sm != null)
sm.checkSetFactory();
if (fac == null)
throw new SocketException("SocketImplFactory cannot be null");
1999-04-07 16:42:40 +02:00
factory = fac;
}
/**
* Closes the input side of the socket stream.
*
* @exception IOException If an error occurs.
*
* @since 1.3
*/
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
public void shutdownInput() throws IOException
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
getImpl().shutdownInput();
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
inputShutdown = true;
}
/**
* Closes the output side of the socket stream.
*
* @exception IOException If an error occurs.
*
* @since 1.3
*/
public void shutdownOutput() throws IOException
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
getImpl().shutdownOutput();
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
outputShutdown = true;
}
/**
* Returns the socket channel associated with this socket.
*
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* @return the associated socket channel,
* null if no associated channel exists
*
* @since 1.4
*/
public SocketChannel getChannel()
{
return null;
}
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
/**
* Checks if the SO_REUSEADDR option is enabled
*
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
* @return True if SO_REUSEADDR is set, false otherwise.
*
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
* @exception SocketException If an error occurs
*
* @since 1.4
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public boolean getReuseAddress() throws SocketException
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
Object reuseaddr = getImpl().getOption(SocketOptions.SO_REUSEADDR);
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
if (! (reuseaddr instanceof Boolean))
throw new SocketException("Internal Error");
return ((Boolean) reuseaddr).booleanValue();
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
}
/**
* Enables/Disables the SO_REUSEADDR option
*
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
* @param reuseAddress true if SO_REUSEADDR should be enabled,
* false otherwise
*
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
* @exception SocketException If an error occurs
*
* @since 1.4
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public void setReuseAddress(boolean reuseAddress) throws SocketException
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
{
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
getImpl().setOption(SocketOptions.SO_REUSEADDR,
Boolean.valueOf(reuseAddress));
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
}
/**
* Returns the current traffic class
*
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
* @return The current traffic class.
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
*
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
* @exception SocketException If an error occurs
*
* @see Socket#setTrafficClass(int tc)
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
*
* @since 1.4
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public int getTrafficClass() throws SocketException
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
Object obj = getImpl().getOption(SocketOptions.IP_TOS);
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
if (obj instanceof Integer)
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
return ((Integer) obj).intValue();
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
else
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
throw new SocketException("Unexpected type");
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
}
/**
* Sets the traffic class value
*
* @param tc The traffic class
*
* @exception SocketException If an error occurs
* @exception IllegalArgumentException If tc value is illegal
*
* @see Socket#getTrafficClass()
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
*
* @since 1.4
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public void setTrafficClass(int tc) throws SocketException
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
if (isClosed())
throw new SocketException("socket is closed");
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
if (tc < 0 || tc > 255)
throw new IllegalArgumentException();
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
getImpl().setOption(SocketOptions.IP_TOS, new Integer(tc));
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
2002-09-25 11:05:53 +02:00
}
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Initialize new instance variables. (close): Reset new instance variables. (getLocalAddress): Remove unneeded SecurityManager usage. (getLocalPort): Check if socket is already bound. (isConnected): New method. (getInetAddress): Implemented. (getPort): Better Implementation, documentation fixed. (getRemoteSocketAddress): New method. * java/net/JarURLConnection.java (element): Typo fixed. (getMainAttributes): New method. (getAttributes): New method (stub only). (getManifest): New method (stub only). * java/net/NetPermission.java: Added serialVersionsUID. * java/net/Socket.java (connect): Check blocking mode of associated channel, documentation added. (getLocalSocketAddress): Better implementation. (getRemoteSocketAddress): Implemented. (isBound): New method. (setSendBufferSize): Documentation added. * java/net/SocketAddress.java: Added serialVersionsUID. * java/net/SocketPermission.java: Added serialVersionsUID. * java/net/URL.java (URL): Wrap for shorter lines, initialize new instance variables, documentation added. (equals): Check new instance variables too. (getContent): Documentation added. (getPath): Documentation added. (getAuthority): New method. (getHost): Documentation added. (getPort): Documentation added. (getDefaultPort): New method. (getProtocol): Documentation added. (getUserInfo): Documentation added. (set): Initialize new instance variables, documentation added. * java/net/URLStreamHandler.java (setURL): New method. * java/net/natPlainDatagramSocketImpl.cc (connect): Fix exception name. (disconnect): Fix exception name. From-SVN: r57501
2002-09-25 19:14:09 +02:00
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
/**
* Checks if the socket is connected
*
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
* @return True if socket is connected, false otherwise.
*
* @since 1.4
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public boolean isConnected()
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
{
try
{
if (getImpl() == null)
return false;
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
return getImpl().getInetAddress() != null;
}
catch (SocketException e)
{
return false;
}
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
}
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Initialize new instance variables. (close): Reset new instance variables. (getLocalAddress): Remove unneeded SecurityManager usage. (getLocalPort): Check if socket is already bound. (isConnected): New method. (getInetAddress): Implemented. (getPort): Better Implementation, documentation fixed. (getRemoteSocketAddress): New method. * java/net/JarURLConnection.java (element): Typo fixed. (getMainAttributes): New method. (getAttributes): New method (stub only). (getManifest): New method (stub only). * java/net/NetPermission.java: Added serialVersionsUID. * java/net/Socket.java (connect): Check blocking mode of associated channel, documentation added. (getLocalSocketAddress): Better implementation. (getRemoteSocketAddress): Implemented. (isBound): New method. (setSendBufferSize): Documentation added. * java/net/SocketAddress.java: Added serialVersionsUID. * java/net/SocketPermission.java: Added serialVersionsUID. * java/net/URL.java (URL): Wrap for shorter lines, initialize new instance variables, documentation added. (equals): Check new instance variables too. (getContent): Documentation added. (getPath): Documentation added. (getAuthority): New method. (getHost): Documentation added. (getPort): Documentation added. (getDefaultPort): New method. (getProtocol): Documentation added. (getUserInfo): Documentation added. (set): Initialize new instance variables, documentation added. * java/net/URLStreamHandler.java (setURL): New method. * java/net/natPlainDatagramSocketImpl.cc (connect): Fix exception name. (disconnect): Fix exception name. From-SVN: r57501
2002-09-25 19:14:09 +02:00
/**
* Checks if the socket is already bound.
*
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
* @return True if socket is bound, false otherwise.
*
* @since 1.4
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Initialize new instance variables. (close): Reset new instance variables. (getLocalAddress): Remove unneeded SecurityManager usage. (getLocalPort): Check if socket is already bound. (isConnected): New method. (getInetAddress): Implemented. (getPort): Better Implementation, documentation fixed. (getRemoteSocketAddress): New method. * java/net/JarURLConnection.java (element): Typo fixed. (getMainAttributes): New method. (getAttributes): New method (stub only). (getManifest): New method (stub only). * java/net/NetPermission.java: Added serialVersionsUID. * java/net/Socket.java (connect): Check blocking mode of associated channel, documentation added. (getLocalSocketAddress): Better implementation. (getRemoteSocketAddress): Implemented. (isBound): New method. (setSendBufferSize): Documentation added. * java/net/SocketAddress.java: Added serialVersionsUID. * java/net/SocketPermission.java: Added serialVersionsUID. * java/net/URL.java (URL): Wrap for shorter lines, initialize new instance variables, documentation added. (equals): Check new instance variables too. (getContent): Documentation added. (getPath): Documentation added. (getAuthority): New method. (getHost): Documentation added. (getPort): Documentation added. (getDefaultPort): New method. (getProtocol): Documentation added. (getUserInfo): Documentation added. (set): Initialize new instance variables, documentation added. * java/net/URLStreamHandler.java (setURL): New method. * java/net/natPlainDatagramSocketImpl.cc (connect): Fix exception name. (disconnect): Fix exception name. From-SVN: r57501
2002-09-25 19:14:09 +02:00
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public boolean isBound()
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Initialize new instance variables. (close): Reset new instance variables. (getLocalAddress): Remove unneeded SecurityManager usage. (getLocalPort): Check if socket is already bound. (isConnected): New method. (getInetAddress): Implemented. (getPort): Better Implementation, documentation fixed. (getRemoteSocketAddress): New method. * java/net/JarURLConnection.java (element): Typo fixed. (getMainAttributes): New method. (getAttributes): New method (stub only). (getManifest): New method (stub only). * java/net/NetPermission.java: Added serialVersionsUID. * java/net/Socket.java (connect): Check blocking mode of associated channel, documentation added. (getLocalSocketAddress): Better implementation. (getRemoteSocketAddress): Implemented. (isBound): New method. (setSendBufferSize): Documentation added. * java/net/SocketAddress.java: Added serialVersionsUID. * java/net/SocketPermission.java: Added serialVersionsUID. * java/net/URL.java (URL): Wrap for shorter lines, initialize new instance variables, documentation added. (equals): Check new instance variables too. (getContent): Documentation added. (getPath): Documentation added. (getAuthority): New method. (getHost): Documentation added. (getPort): Documentation added. (getDefaultPort): New method. (getProtocol): Documentation added. (getUserInfo): Documentation added. (set): Initialize new instance variables, documentation added. * java/net/URLStreamHandler.java (setURL): New method. * java/net/natPlainDatagramSocketImpl.cc (connect): Fix exception name. (disconnect): Fix exception name. From-SVN: r57501
2002-09-25 19:14:09 +02:00
{
return bound;
2002-09-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (DatagramSocket): Initialize new instance variables. (close): Reset new instance variables. (getLocalAddress): Remove unneeded SecurityManager usage. (getLocalPort): Check if socket is already bound. (isConnected): New method. (getInetAddress): Implemented. (getPort): Better Implementation, documentation fixed. (getRemoteSocketAddress): New method. * java/net/JarURLConnection.java (element): Typo fixed. (getMainAttributes): New method. (getAttributes): New method (stub only). (getManifest): New method (stub only). * java/net/NetPermission.java: Added serialVersionsUID. * java/net/Socket.java (connect): Check blocking mode of associated channel, documentation added. (getLocalSocketAddress): Better implementation. (getRemoteSocketAddress): Implemented. (isBound): New method. (setSendBufferSize): Documentation added. * java/net/SocketAddress.java: Added serialVersionsUID. * java/net/SocketPermission.java: Added serialVersionsUID. * java/net/URL.java (URL): Wrap for shorter lines, initialize new instance variables, documentation added. (equals): Check new instance variables too. (getContent): Documentation added. (getPath): Documentation added. (getAuthority): New method. (getHost): Documentation added. (getPort): Documentation added. (getDefaultPort): New method. (getProtocol): Documentation added. (getUserInfo): Documentation added. (set): Initialize new instance variables, documentation added. * java/net/URLStreamHandler.java (setURL): New method. * java/net/natPlainDatagramSocketImpl.cc (connect): Fix exception name. (disconnect): Fix exception name. From-SVN: r57501
2002-09-25 19:14:09 +02:00
}
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
/**
* Checks if the socket is closed.
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
*
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
* @return True if socket is closed, false otherwise.
*
* @since 1.4
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public boolean isClosed()
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
{
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
return impl == null;
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
}
/**
* Checks if the socket's input stream is shutdown
*
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
* @return True if input is shut down.
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
*
* @since 1.4
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public boolean isInputShutdown()
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
{
return inputShutdown;
}
/**
* Checks if the socket's output stream is shutdown
*
2003-11-25 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (factory): Made private. (closed): Removed. (DatagramSocket): Check impl argument, use constructor with SocketAddress argument. (close): Set impl to null, use isClosed(). (isClosed): Check for impl == null. (getLocalAddress): Use isClosed(). (getLocalPort): Check if socket is closed. (getSoTimeout): Likewise. (setSoTimeout): Likewise. (getSendBufferSize): Likewise. (setSendBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setReceiveBufferSize): Likewise. (receive): Likewise. (send): Likewise. (bind): Likewise. (connect): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setBroadcast): Likewise. (getBroadcast): Likewise. (setTrafficClass): Likewise. (getTrafficClass): Likewise. * java/net/MulticastSocket.java (getInterface): Check if socket is closed. (getTTL): Likewise. (getTimeToLive): Likewise. (setInterface): Likewise. (setNetworkInterface): Likewise. (getNetworkInterface): Likewise. (setLoopbackMode): Likewise. (setTTL): Likewise. (setTimeToLive): Likewise. (joinGroup): Likewise. (leaveGroup): Likewise. (send): Likewise. * java/net/ServerSocket.java (closed): Removed. (close): Check if socket is closed, set impl to null. (isClosed): Check impl == null; (ServerSocket): Check impl argument. (getInetAddress): Check if socket is bound. (getLocalPort): Likewise. (getLocalSocketAddress): Likewise. (bind): Check if socket is closed. (implAccept): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setReuseAddress): Likewise. (getReuseAddress): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (toString): Make output compliant to JDK 1.4.2. * java/net/Socket.java (closed): Removed. (Socket): Fixed documentation. (connect): Check if socket is closed, changed exception text, fixed documentation. (getInputStream): Check of socket is closed and connected. (getOutputStream): Likewise. (bind): Check if socket is closed. (setTcpNoDelay): Likewise. (getTcpNoDelay): Likewise. (setSoLinger): Likewise. (getSoLinger): Likewise. (sendUrgentData): Likewise. (setOOBInline): Likewise. (getOOBInline): Likewise. (setSoTimeout): Likewise. (getSoTimeout): Likewise. (setSendBufferSize): Likewise. (getSendBufferSize): Likewise. (setReceiveBufferSize): Likewise. (getReceiveBufferSize): Likewise. (setKeepAlive): Likewise. (getKeepAlive): Likewise. (close): Likewise. (shutdownInput): Likewise. (shutdownOutput): Likewise. (getReuseAddress): Likewise. (getTrafficClass): Likewise. (setTrafficClass): Likewise. (isClosed): Check impl == null. (toString): Added missing ']'. From-SVN: r73918
2003-11-25 11:09:48 +01:00
* @return True if output is shut down.
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
*
* @since 1.4
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
*/
Authenticator.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch <konqueror@gmx.de> * java/net/Authenticator.java, java/net/BindException.java, java/net/ConnectException.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramPacket.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/InetAddress.java, java/net/InetSocketAddress.java, java/net/JarURLConnection.java, java/net/MalformedURLException.java, java/net/MulticastSocket.java, java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/NoRouteToHostException.java, java/net/PasswordAuthentication.java, java/net/PortUnreachableException.java, java/net/ProtocolException.java, java/net/ServerSocket.java, java/net/Socket.java, java/net/SocketAddress.java, java/net/SocketException.java, java/net/SocketImpl.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/SocketPermission.java, java/net/SocketTimeoutException.java, java/net/URI.java, java/net/URISyntaxException.java, java/net/URL.java, java/net/URLClassLoader.java, java/net/URLConnection.java, java/net/URLDecoder.java, java/net/URLEncoder.java, java/net/URLStreamHandler.java, java/net/URLStreamHandlerFactory.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80900
2004-04-20 15:05:10 +02:00
public boolean isOutputShutdown()
2002-09-30 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (receive): Check with SecurityManager AFTER the packet is received, check if connected to multicast address, documentation added. (send): Only check SecurityManager if connected, check address of packet to send. (connect): Implemented, documentation added. * java/net/Inet6Address.java: New file (not added yet to Makefile.am). * java/net/InetSocketAddress.java (whole file): Reindented. (hostname): New attribute. (InetSocketAddress): Initialize new attribute. (getAddress): Documentation added. (getHostName): Documentation added. (getPort): Documentation added. (hashCode): Documentation added. (isUnresolved): Documentation added. (toString): Conform to output of JDK 1.4.1, documentation added. * java/net/MulticastSocket.java (joinGroup): Removed FIXME, documentation added. (leaveGroup): Removed FIXME, documentation added. (send): Documentation added. * java/net/Socket.java (inputShutdown): New variable. (outputShutdown): New variable. (Socket): Initialize new variables. (getRemoteSocketAddress): Check if connected. (shutdownInput): Set new variable. (shutdownOutput): Set new variable. (isConnected): New method. (isClosed): New method. (isInputShutdown): New method. (isOutputShutdown): New method. * java/net/URLStreamHandler.java (URLStreamHandler): New method. (openConnection): Added documentation. (parseURL): Added documentation. (getHostAddress): New method. (getDefaultPort): New method. From-SVN: r57772
2002-10-03 13:23:33 +02:00
{
return outputShutdown;
}
1999-04-07 16:42:40 +02:00
}