Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
protected void | accept(SocketImpl
the accepted connection. si)Implements abstract java. Accepts a connection. |
protected int | available()
Implements abstract java. Returns the number of bytes that can be read from this socket without blocking. |
protected void | bind(InetAddress
an IP address that belongs to a local interface. host, int the port number. port)Implements abstract java. Binds this socket to the specified local IP address and port number. |
protected void | |
protected void | connect(SocketAddress
the Socket address of the remote host. remote, int the timeout value, in milliseconds, or zero for no timeout. millis)Implements abstract java. Connects this socket to the specified port number on the specified host. |
protected void | connect(String
the name of the remote host. host, int the port number. port)Implements abstract java. Connects this socket to the specified port on the named host. |
protected void | connect(InetAddress
the IP address of the remote host. address, int the port number. port)Implements abstract java. Connects this socket to the specified port number on the specified host. |
pack-priv static SocketImpl | |
protected void | create(boolean
if stream)true , create a stream socket;
otherwise, create a datagram socket.Implements abstract java. Creates either a stream or a datagram socket. |
protected InputStream | getInputStream()
Implements abstract java. Returns an input stream for this socket. |
protected <T> T | getOption(SocketOption<T>
The socket option opt)Overrides java. Called to get a socket option. |
public Object | getOption(int
an opt)int identifying the option to fetchImplements java. Fetch the value of an option. |
protected OutputStream | getOutputStream()
Implements abstract java. Returns an output stream for this socket. |
protected void | listen(int
the maximum length of the queue. backlog)Implements abstract java. Sets the maximum queue length for incoming connection indications
(a request to connect) to the |
protected void | sendUrgentData(int
The byte of data to send data)Implements abstract java. Send one byte of urgent data on the socket. |
protected <T> void | setOption(SocketOption<T>
The socket option opt, T The value of the socket option. A value of value)null
may be valid for some options.Overrides java. Called to set a socket option. |
public void | setOption(int
identifies the option opt, Object the parameter of the socket option value)Implements java. Enable/disable the option specified by |
private static <T> T | |
protected void | shutdownInput()
Overrides java. Places the input stream for this socket at "end of stream". |
protected void | shutdownOutput()
Overrides java. Disables the output stream for this socket. |
protected Set | supportedOptions()
Overrides java. Returns a set of SocketOptions supported by this impl and by this impl's socket (Socket or ServerSocket) |
protected boolean | supportsUrgentData()
Overrides java. Returns whether or not this SocketImpl supports sending urgent data. |
DummySocketImpl | back to summary |
---|---|
private DummySocketImpl() |
accept | back to summary |
---|---|
protected void accept(SocketImpl si) Implements abstract java. Doc from java. Accepts a connection.
|
available | back to summary |
---|---|
protected int available() Implements abstract java. Doc from java. Returns the number of bytes that can be read from this socket without blocking.
|
bind | back to summary |
---|---|
protected void bind(InetAddress host, int port) Implements abstract java. Doc from java. Binds this socket to the specified local IP address and port number.
|
close | back to summary |
---|---|
protected void close() Implements abstract java. Doc from java. Closes this socket.
|
connect | back to summary |
---|---|
protected void connect(SocketAddress remote, int millis) Implements abstract java. Doc from java. Connects this socket to the specified port number on the specified host. A timeout of zero is interpreted as an infinite timeout. The connection will then block until established or an error occurs.
|
connect | back to summary |
---|---|
protected void connect(String host, int port) Implements abstract java. Doc from java. Connects this socket to the specified port on the named host. |
connect | back to summary |
---|---|
protected void connect(InetAddress address, int port) Implements abstract java. Doc from java. Connects this socket to the specified port number on the specified host.
|
create | back to summary |
---|---|
pack-priv static SocketImpl create() |
create | back to summary |
---|---|
protected void create(boolean stream) Implements abstract java. Doc from java. Creates either a stream or a datagram socket.
|
getInputStream | back to summary |
---|---|
protected InputStream getInputStream() Implements abstract java. Doc from java. Returns an input stream for this socket.
|
getOption | back to summary |
---|---|
protected <T> T getOption(SocketOption<T> opt) Overrides java. Doc from java. Called to get a socket option.
|
getOption | back to summary |
---|---|
public Object getOption(int opt) Implements java. Doc from java. Fetch the value of an option. Binary options will return SocketImpl s; ... Boolean noDelay = (Boolean)(s.getOption(TCP_NODELAY)); if (noDelay.booleanValue()) { // true if TCP_NODELAY is enabled... ... }
For options that take a particular type as a parameter, this method will return the
parameter's value, else it will return Object o = s.getOption(SO_LINGER); if (o instanceof Integer) { System.out.print("Linger time is " + ((Integer)o).intValue()); } else { // the true type of o is java.lang.Boolean.FALSE; } |
getOutputStream | back to summary |
---|---|
protected OutputStream getOutputStream() Implements abstract java. Doc from java. Returns an output stream for this socket.
|
listen | back to summary |
---|---|
protected void listen(int backlog) Implements abstract java. Doc from java. Sets the maximum queue length for incoming connection indications
(a request to connect) to the
|
sendUrgentData | back to summary |
---|---|
protected void sendUrgentData(int data) Implements abstract java. Doc from java. Send one byte of urgent data on the socket. The byte to be sent is the low eight bits of the parameter
|
setOption | back to summary |
---|---|
protected <T> void setOption(SocketOption<T> opt, T value) Overrides java. Doc from java. Called to set a socket option.
|
setOption | back to summary |
---|---|
public void setOption(int opt, Object value) Implements java. Doc from java. Enable/disable the option specified by SocketImpl s; ... s.setOption(SO_LINGER, Integer.valueOf(10)); // OK - set SO_LINGER w/ timeout of 10 sec. s.setOption(SO_LINGER, Double.valueOf(10)); // ERROR - expects java.lang.Integer Boolean :
s.setOption(TCP_NODELAY, Boolean.TRUE); // OK - enables TCP_NODELAY, a binary option Boolean#FALSE :
s.setOption(TCP_NODELAY, Boolean.FALSE); // OK - disables TCP_NODELAY s.setOption(SO_LINGER, Boolean.FALSE); // OK - disables SO_LINGER Boolean#FALSE implicitly enables it.
|
shouldNotGetHere | back to summary |
---|---|
private static <T> T shouldNotGetHere() |
shutdownInput | back to summary |
---|---|
protected void shutdownInput() Overrides java. Doc from java. Places the input stream for this socket at "end of stream".
Any data sent to this socket is acknowledged and then
silently discarded.
If you read from a socket input stream after invoking this method on the
socket, the stream's
|
shutdownOutput | back to summary |
---|---|
protected void shutdownOutput() Overrides java. Doc from java. Disables the output stream for this socket. For a TCP socket, any previously written data will be sent followed by TCP's normal connection termination sequence. If you write to a socket output stream after invoking shutdownOutput() on the socket, the stream will throw an IOException.
|
supportedOptions | back to summary |
---|---|
protected Set Overrides java. Doc from java. Returns a set of SocketOptions supported by this impl and by this impl's socket (Socket or ServerSocket)
|
supportsUrgentData | back to summary |
---|---|
protected boolean supportsUrgentData() Overrides java. Doc from java. Returns whether or not this SocketImpl supports sending urgent data. By default, false is returned unless the method is overridden in a sub-class
|