mngttest
Class JSSELocalClient.JSSEClientSocket

java.lang.Object
  |
  +--java.net.Socket
        |
        +--mngttest.JSSELocalClient.JSSEClientSocket
Enclosing class:
JSSELocalClient

static class JSSELocalClient.JSSEClientSocket
extends java.net.Socket


Field Summary
(package private)  org.ssonet.net.SSONETContext ctx
           
(package private)  javax.net.ssl.SSLSocket socket
           
 
Fields inherited from class java.net.Socket
 
Constructor Summary
(package private) JSSELocalClient.JSSEClientSocket(javax.net.ssl.SSLSocket socket, org.ssonet.net.SSONETContext ctx)
           
 
Method Summary
 void close()
          Closes the SSONETServerClientSocket.
 org.ssonet.net.SSONETContext getContext()
           
 java.net.InetAddress getInetAddress()
          Returns the address to which the socket is connected.
 java.io.InputStream getInputStream()
          Returns the InputStream of this Socket.
 boolean getKeepAlive()
          Tests if SO_KEEPALIVE is enabled.
 java.net.InetAddress getLocalAddress()
          Gets the local address to which the socket is bound.
 int getLocalPort()
          Returns the local port to which this socket is bound.
 java.io.OutputStream getOutputStream()
          Returns the OutputStream of this Socket.
 int getPort()
          Returns the remote port to which this socket is connected.
 int getReceiveBufferSize()
          Gets the value of the SO_RCVBUF option for this Socket, that is the buffer size used by the platform for input on this Socket.
 int getSendBufferSize()
          Get value of the SO_SNDBUF option for this Socket, that is the buffer size used by the platform for output on this Socket.
 int getSoLinger()
          Returns setting for SO_LINGER.
 int getSoTimeout()
          Returns setting for SO_TIMEOUT.
 boolean getTcpNoDelay()
          Tests if TCP_NODELAY is enabled.
 void setKeepAlive(boolean on)
          Enable/disable SO_KEEPALIVE.
 void setReceiveBufferSize(int size)
          Sets the SO_RCVBUF option to the specified value for this Socket.
 void setSendBufferSize(int size)
          Sets the SO_SNDBUF option to the specified value for this Socket.
 void setSoLinger(boolean on, int linger)
          Enable/disable SO_LINGER with the specified linger time in seconds.
 void setSoTimeout(int timeout)
          Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
 void setTcpNoDelay(boolean on)
          Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm).
 void shutdownInput()
          Places the input stream for this socket at "end of stream".
 void shutdownOutput()
          Disables the output stream for this socket.
 java.lang.String toString()
          Converts this socket to a String.
 
Methods inherited from class java.net.Socket
bind, connect, connect, getChannel, getLocalSocketAddress, getOOBInline, getRemoteSocketAddress, getReuseAddress, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setOOBInline, setReuseAddress, setSocketImplFactory, setTrafficClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

socket

javax.net.ssl.SSLSocket socket

ctx

org.ssonet.net.SSONETContext ctx
Constructor Detail

JSSELocalClient.JSSEClientSocket

JSSELocalClient.JSSEClientSocket(javax.net.ssl.SSLSocket socket,
                                 org.ssonet.net.SSONETContext ctx)
Method Detail

getContext

public org.ssonet.net.SSONETContext getContext()

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Returns the InputStream of this Socket. If the connection was not already initialized, this is done before returning.

Overrides:
getInputStream in class java.net.Socket
Returns:
the InputStream
java.io.IOException

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Returns the OutputStream of this Socket. If the connection was not already initialized, this is done before returning.

Overrides:
getOutputStream in class java.net.Socket
Returns:
the OutputStream
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes the SSONETServerClientSocket. The Socket cannot be reused after closing.

Overrides:
close in class java.net.Socket
java.io.IOException

getInetAddress

public java.net.InetAddress getInetAddress()
Returns the address to which the socket is connected.

Overrides:
getInetAddress in class java.net.Socket
Returns:
the remote IP address to which this socket is connected.

getLocalAddress

public java.net.InetAddress getLocalAddress()
Gets the local address to which the socket is bound.

Overrides:
getLocalAddress in class java.net.Socket
Returns:
the local address to which the socket is bound.
Since:
JDK1.1

getPort

public int getPort()
Returns the remote port to which this socket is connected.

Overrides:
getPort in class java.net.Socket
Returns:
the remote port number to which this socket is connected.

getLocalPort

public int getLocalPort()
Returns the local port to which this socket is bound.

Overrides:
getLocalPort in class java.net.Socket
Returns:
the local port number to which this socket is connected.

setTcpNoDelay

public void setTcpNoDelay(boolean on)
                   throws java.net.SocketException
Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm).

Overrides:
setTcpNoDelay in class java.net.Socket
Parameters:
on - true to enable TCP_NODELAY, false to disable.
Throws:
java.net.SocketException - if there is an error in the underlying protocol, such as a TCP error.
Since:
JDK1.1
See Also:
getTcpNoDelay()

getTcpNoDelay

public boolean getTcpNoDelay()
                      throws java.net.SocketException
Tests if TCP_NODELAY is enabled.

Overrides:
getTcpNoDelay in class java.net.Socket
Returns:
a boolean indicating whether or not TCP_NODELAY is enabled.
Throws:
java.net.SocketException - if there is an error in the underlying protocol, such as a TCP error.
Since:
JDK1.1
See Also:
setTcpNoDelay(boolean)

setSoLinger

public void setSoLinger(boolean on,
                        int linger)
                 throws java.net.SocketException
Enable/disable SO_LINGER with the specified linger time in seconds. The maximum timeout value is platform specific. The setting only affects socket close.

Overrides:
setSoLinger in class java.net.Socket
Parameters:
on - whether or not to linger on.
linger - how to linger for, if on is true.
Throws:
java.net.SocketException - if there is an error in the underlying protocol, such as a TCP error.
java.lang.IllegalArgumentException - if the linger value is negative.
Since:
JDK1.1
See Also:
getSoLinger()

getSoLinger

public int getSoLinger()
                throws java.net.SocketException
Returns setting for SO_LINGER. Return -1 implies that the option is disabled. The setting only affects socket close.

Overrides:
getSoLinger in class java.net.Socket
Returns:
the setting for SO_LINGER.
Throws:
java.net.SocketException - if there is an error in the underlying protocol, such as a TCP error.
Since:
JDK1.1
See Also:
setSoLinger(boolean, int)

setSoTimeout

public void setSoTimeout(int timeout)
                  throws java.net.SocketException
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. With this option set to a non-zero timeout, a read() call on the InputStream associated with this Socket will block for only this amount of time. If the timeout expires, a java.io.InterruptedIOException is raised, though the Socket is still valid. The option must be enabled prior to entering the blocking operation to have effect. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout.

Overrides:
setSoTimeout in class java.net.Socket
Parameters:
timeout - the specified timeout, in milliseconds.
Throws:
java.net.SocketException - if there is an error in the underlying protocol, such as a TCP error.
Since:
JDK 1.1
See Also:
getSoTimeout()

getSoTimeout

public int getSoTimeout()
                 throws java.net.SocketException
Returns setting for SO_TIMEOUT. Return 0 implies that the option is disabled (i.e., timeout of infinity).

Overrides:
getSoTimeout in class java.net.Socket
Returns:
the setting for SO_TIMEOUT
Throws:
java.net.SocketException - if there is an error in the underlying protocol, such as a TCP error.
Since:
JDK1.1
See Also:
setSoTimeout(int)

setSendBufferSize

public void setSendBufferSize(int size)
                       throws java.net.SocketException
Sets the SO_SNDBUF option to the specified value for this Socket. The SO_SNDBUF option is used by the platform's networking code as a hint for the size to set the underlying network I/O buffers.

Increasing buffer size can increase the performance of network I/O for high-volume connection, while decreasing it can help reduce the backlog of incoming data. For UDP, this sets the maximum size of a packet that may be sent on this Socket.

Because SO_SNDBUF is a hint, applications that want to verify what size the buffers were set to should call getSendBufferSize().

Overrides:
setSendBufferSize in class java.net.Socket
Parameters:
size - the size to which to set the send buffer size. This value must be greater than 0.
Throws:
java.net.SocketException - if there is an error in the underlying protocol, such as a TCP error.
java.lang.IllegalArgumentException - if the value is 0 or is negative.
See Also:
getSendBufferSize()

getSendBufferSize

public int getSendBufferSize()
                      throws java.net.SocketException
Get value of the SO_SNDBUF option for this Socket, that is the buffer size used by the platform for output on this Socket.

Overrides:
getSendBufferSize in class java.net.Socket
Returns:
the value of the SO_SNDBUF option for this Socket.
Throws:
java.net.SocketException - if there is an error in the underlying protocol, such as a TCP error.
See Also:
setSendBufferSize(int)

setReceiveBufferSize

public void setReceiveBufferSize(int size)
                          throws java.net.SocketException
Sets the SO_RCVBUF option to the specified value for this Socket. The SO_RCVBUF option is used by the platform's networking code as a hint for the size to set the underlying network I/O buffers.

Increasing buffer size can increase the performance of network I/O for high-volume connection, while decreasing it can help reduce the backlog of incoming data. For UDP, this sets the maximum size of a packet that may be sent on this Socket.

Because SO_RCVBUF is a hint, applications that want to verify what size the buffers were set to should call getReceiveBufferSize().

Overrides:
setReceiveBufferSize in class java.net.Socket
Parameters:
size - the size to which to set the receive buffer size. This value must be greater than 0.
Throws:
java.lang.IllegalArgumentException - if the value is 0 or is negative.
java.net.SocketException - if there is an error in the underlying protocol, such as a TCP error.
See Also:
getReceiveBufferSize()

getReceiveBufferSize

public int getReceiveBufferSize()
                         throws java.net.SocketException
Gets the value of the SO_RCVBUF option for this Socket, that is the buffer size used by the platform for input on this Socket.

Overrides:
getReceiveBufferSize in class java.net.Socket
Returns:
the value of the SO_RCVBUF option for this Socket.
Throws:
java.net.SocketException - if there is an error in the underlying protocol, such as a TCP error.
See Also:
setReceiveBufferSize(int)

setKeepAlive

public void setKeepAlive(boolean on)
                  throws java.net.SocketException
Enable/disable SO_KEEPALIVE.

Overrides:
setKeepAlive in class java.net.Socket
Parameters:
on - whether or not to have socket keep alive turned on.
Throws:
java.net.SocketException - if there is an error in the underlying protocol, such as a TCP error.
Since:
1.3
See Also:
getKeepAlive()

getKeepAlive

public boolean getKeepAlive()
                     throws java.net.SocketException
Tests if SO_KEEPALIVE is enabled.

Overrides:
getKeepAlive in class java.net.Socket
Returns:
a boolean indicating whether or not SO_KEEPALIVE is enabled.
Throws:
java.net.SocketException - if there is an error in the underlying protocol, such as a TCP error.
Since:
1.3
See Also:
setKeepAlive(boolean)

shutdownInput

public void shutdownInput()
                   throws java.io.IOException
Places the input stream for this socket at "end of stream". Any data sent to the input stream side of the socket is acknowledged and then silently discarded. If you read from a socket input stream after invoking shutdownInput() on the socket, the stream will return EOF.

Overrides:
shutdownInput in class java.net.Socket
Throws:
java.io.IOException - if an I/O error occurs when shutting down this socket.
See Also:
Socket.shutdownOutput(), Socket.close(), Socket.setSoLinger(boolean, int)

shutdownOutput

public void shutdownOutput()
                    throws java.io.IOException
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.

Overrides:
shutdownOutput in class java.net.Socket
Throws:
java.io.IOException - if an I/O error occurs when shutting down this socket.
See Also:
Socket.shutdownInput(), Socket.close(), Socket.setSoLinger(boolean, int)

toString

public java.lang.String toString()
Converts this socket to a String.

Overrides:
toString in class java.net.Socket
Returns:
a string representation of this socket.


Copyright © 2003 DRIM Team. All Rights Reserved.