|
|||||||||
| Home >> All >> java >> [ net overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.net
Class ZSocketImpl

java.lang.Objectjava.net.SocketImpl
java.net.PlainSocketImpl
java.net.ZSocketImpl
- All Implemented Interfaces:
- SocketOptions
- class ZSocketImpl
- extends PlainSocketImpl
This class is the main entry point to the compression layer. It provides method to deal with compressed objects through the incapsulation into streams.
- Version:
- 1.0
| Nested Class Summary | |
(package private) class |
PlainSocketImpl.SocketInputStream
A stream which reads from the socket implementation. |
(package private) class |
PlainSocketImpl.SocketOutputStream
A stream which writes to the socket implementation. |
| Field Summary | |
(package private) static int |
_Jv_IP_MULTICAST_IF_
|
(package private) static int |
_Jv_IP_MULTICAST_IF2_
|
(package private) static int |
_Jv_IP_MULTICAST_LOOP_
|
(package private) static int |
_Jv_IP_TOS_
|
(package private) static int |
_Jv_SO_BINDADDR_
|
(package private) static int |
_Jv_SO_BROADCAST_
|
(package private) static int |
_Jv_SO_KEEPALIVE_
|
(package private) static int |
_Jv_SO_LINGER_
|
(package private) static int |
_Jv_SO_OOBINLINE_
|
(package private) static int |
_Jv_SO_RCVBUF_
|
(package private) static int |
_Jv_SO_REUSEADDR_
|
(package private) static int |
_Jv_SO_SNDBUF_
|
(package private) static int |
_Jv_SO_TIMEOUT_
|
(package private) static int |
_Jv_TCP_NODELAY_
|
protected Connector |
conn
The Connector is responsible for packet handling. |
(package private) int |
fnum
The OS file handle representing the socket. |
protected java.io.InputStream |
input
|
(package private) InetAddress |
localAddress
|
protected java.io.OutputStream |
output
|
(package private) int |
timeout
|
| Fields inherited from class java.net.SocketImpl |
address, fd, localport, port |
| Fields inherited from interface java.net.SocketOptions |
IP_MULTICAST_IF, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS, SO_BINDADDR, SO_BROADCAST, SO_KEEPALIVE, SO_LINGER, SO_OOBINLINE, SO_RCVBUF, SO_REUSEADDR, SO_SNDBUF, SO_TIMEOUT, TCP_NODELAY |
| Constructor Summary | |
(package private) |
ZSocketImpl()
|
| Method Summary | |
protected void |
accept(SocketImpl s)
Accepts a connection on this socket. |
protected int |
available()
Returns the number of bytes that the caller can read from this socket without blocking. |
protected void |
bind(InetAddress host,
int port)
Binds to the specified port on the specified addr. |
void |
close()
This method stops the connector before object deallocation. |
protected void |
connect(InetAddress host,
int port)
Connects to the remote address and port specified as arguments. |
protected void |
connect(SocketAddress addr,
int timeout)
Connects to the socket to the host specified in address. |
protected void |
connect(java.lang.String host,
int port)
Connects to the remote hostname and port specified as arguments. |
protected void |
create(boolean stream)
Creates a new socket that is not bound to any local address/port and is not connected to any remote address/port. |
protected void |
finalize()
Called on an object by the Virtual Machine at most once, at some point after the Object is determined unreachable but before it is destroyed. |
java.io.InputStream |
getInputStream()
When this method is first invoked, a connector is created with a SocketInputStream and a SocketOutputStream bound to it. |
java.lang.Object |
getOption(int optID)
Returns the current setting of the specified option. |
protected java.io.OutputStream |
getOutputStream()
When this method is first invoked, a connector is created with a SocketInputStream and a SocketOutputStream bound to it. |
protected void |
listen(int backlog)
Starts listening for connections on a socket. |
protected void |
sendUrgentData(int data)
Sends one byte of urgent data to the socket. |
void |
setOption(int optID,
java.lang.Object value)
Sets the specified option on a socket to the passed in object. |
void |
shutdownInput()
Shut down the input side of this socket. |
void |
shutdownOutput()
Shut down the output side of this socket. |
| Methods inherited from class java.net.SocketImpl |
getFileDescriptor, getInetAddress, getLocalPort, getPort, supportsUrgentData, toString |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
conn
protected Connector conn
- The Connector is responsible for packet handling.
- See Also:
- Connector
input
protected java.io.InputStream input
output
protected java.io.OutputStream output
_Jv_TCP_NODELAY_
static final int _Jv_TCP_NODELAY_
- See Also:
- Constant Field Values
_Jv_SO_BINDADDR_
static final int _Jv_SO_BINDADDR_
- See Also:
- Constant Field Values
_Jv_SO_REUSEADDR_
static final int _Jv_SO_REUSEADDR_
- See Also:
- Constant Field Values
_Jv_SO_BROADCAST_
static final int _Jv_SO_BROADCAST_
- See Also:
- Constant Field Values
_Jv_SO_OOBINLINE_
static final int _Jv_SO_OOBINLINE_
- See Also:
- Constant Field Values
_Jv_IP_MULTICAST_IF_
static final int _Jv_IP_MULTICAST_IF_
- See Also:
- Constant Field Values
_Jv_IP_MULTICAST_IF2_
static final int _Jv_IP_MULTICAST_IF2_
- See Also:
- Constant Field Values
_Jv_IP_MULTICAST_LOOP_
static final int _Jv_IP_MULTICAST_LOOP_
- See Also:
- Constant Field Values
_Jv_IP_TOS_
static final int _Jv_IP_TOS_
- See Also:
- Constant Field Values
_Jv_SO_LINGER_
static final int _Jv_SO_LINGER_
- See Also:
- Constant Field Values
_Jv_SO_TIMEOUT_
static final int _Jv_SO_TIMEOUT_
- See Also:
- Constant Field Values
_Jv_SO_SNDBUF_
static final int _Jv_SO_SNDBUF_
- See Also:
- Constant Field Values
_Jv_SO_RCVBUF_
static final int _Jv_SO_RCVBUF_
- See Also:
- Constant Field Values
_Jv_SO_KEEPALIVE_
static final int _Jv_SO_KEEPALIVE_
- See Also:
- Constant Field Values
fnum
int fnum
- The OS file handle representing the socket.
This is used for reads and writes to/from the socket and
to close it.
When the socket is closed this is reset to -1.
timeout
int timeout
localAddress
InetAddress localAddress
| Constructor Detail |
ZSocketImpl
ZSocketImpl()
| Method Detail |
getOutputStream
protected java.io.OutputStream getOutputStream() throws java.io.IOException
- When this method is first invoked, a connector is created with a SocketInputStream and a
SocketOutputStream bound to it.
Then a new (compressed) OutputStream is created and returned.
- Overrides:
getOutputStreamin classPlainSocketImpl
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
- When this method is first invoked, a connector is created with a SocketInputStream and a
SocketOutputStream bound to it.
Then a new (compressed) InputStream is created and returned.
- Overrides:
getInputStreamin classPlainSocketImpl
close
public void close()
throws java.io.IOException
- This method stops the connector before object deallocation.
- Overrides:
closein classPlainSocketImpl
setOption
public void setOption(int optID,
java.lang.Object value)
throws SocketException
- Description copied from interface:
SocketOptions - Sets the specified option on a socket to the passed in object. For
options that take an integer argument, the passed in object is an
Integer. For options that are set to on or off, the value passed will be aBoolean. TheoptionIdparameter is one of the defined constants in this interface.
getOption
public java.lang.Object getOption(int optID) throws SocketException
- Description copied from interface:
SocketOptions - Returns the current setting of the specified option. The
Objectreturned will be anIntegerfor options that have integer values. For options that are set to on or off, aBooleanwill be returned. TheoptionIdparameter is one of the defined constants in this interface.
shutdownInput
public void shutdownInput()
throws java.io.IOException
- Description copied from class:
SocketImpl - Shut down the input side of this socket. Subsequent reads will
return end-of-file.
- Overrides:
shutdownInputin classSocketImpl
shutdownOutput
public void shutdownOutput()
throws java.io.IOException
- Description copied from class:
SocketImpl - Shut down the output side of this socket. Subsequent writes will
fail with an IOException.
- Overrides:
shutdownOutputin classSocketImpl
create
protected void create(boolean stream)
throws java.io.IOException
- Description copied from class:
SocketImpl - Creates a new socket that is not bound to any local address/port and
is not connected to any remote address/port. This will be created as
a stream socket if the stream parameter is true, or a datagram socket
if the stream parameter is false.
- Specified by:
createin classSocketImpl
connect
protected void connect(java.lang.String host, int port) throws java.io.IOException
- Description copied from class:
SocketImpl - Connects to the remote hostname and port specified as arguments.
- Specified by:
connectin classSocketImpl
connect
protected void connect(InetAddress host, int port) throws java.io.IOException
- Description copied from class:
SocketImpl - Connects to the remote address and port specified as arguments.
- Specified by:
connectin classSocketImpl
connect
protected void connect(SocketAddress addr, int timeout) throws java.io.IOException
- Description copied from class:
SocketImpl - Connects to the socket to the host specified in address. This
method blocks until successful connected or the timeout occurs.
A timeout of zero means no timout.
- Specified by:
connectin classSocketImpl
bind
protected void bind(InetAddress host, int port) throws java.io.IOException
- Description copied from class:
SocketImpl - Binds to the specified port on the specified addr. Note that this addr
must represent a local IP address.
Note that it is unspecified how to bind to all interfaces on the localhost (INADDR_ANY).
- Specified by:
bindin classSocketImpl
listen
protected void listen(int backlog)
throws java.io.IOException
- Description copied from class:
SocketImpl - Starts listening for connections on a socket. The backlog parameter
is how many pending connections will queue up waiting to be serviced
before being accept'ed. If the queue of pending requests exceeds this
number, additional connections will be refused.
- Specified by:
listenin classSocketImpl
accept
protected void accept(SocketImpl s) throws java.io.IOException
- Description copied from class:
SocketImpl - Accepts a connection on this socket.
- Specified by:
acceptin classSocketImpl
available
protected int available()
throws java.io.IOException
- Description copied from class:
SocketImpl - Returns the number of bytes that the caller can read from this socket
without blocking.
- Specified by:
availablein classSocketImpl
sendUrgentData
protected void sendUrgentData(int data)
throws java.io.IOException
- Description copied from class:
SocketImpl - Sends one byte of urgent data to the socket.
- Specified by:
sendUrgentDatain classSocketImpl
finalize
protected void finalize()
throws java.lang.Throwable
- Description copied from class:
java.lang.Object - Called on an object by the Virtual Machine at most once,
at some point after the Object is determined unreachable
but before it is destroyed. You would think that this
means it eventually is called on every Object, but this is
not necessarily the case. If execution terminates
abnormally, garbage collection does not always happen.
Thus you cannot rely on this method to always work.
For finer control over garbage collection, use references
from the
java.lang.refpackage.Virtual Machines are free to not call this method if they can determine that it does nothing important; for example, if your class extends Object and overrides finalize to do simply
super.finalize().finalize() will be called by a java.lang.Thread that has no locks on any Objects, and may be called concurrently. There are no guarantees on the order in which multiple objects are finalized. This means that finalize() is usually unsuited for performing actions that must be thread-safe, and that your implementation must be use defensive programming if it is to always work.
If an Exception is thrown from finalize() during garbage collection, it will be patently ignored and the Object will still be destroyed.
It is allowed, although not typical, for user code to call finalize() directly. User invocation does not affect whether automatic invocation will occur. It is also permitted, although not recommended, for a finalize() method to "revive" an object by making it reachable from normal code again.
Unlike constructors, finalize() does not get called for an object's superclass unless the implementation specifically calls
super.finalize().The default implementation does nothing.
|
|||||||||
| Home >> All >> java >> [ net overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC