|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.net.Socket
org.jboss.remoting.transport.multiplex.VirtualSocket
public class VirtualSocket
Copyright (c) 2005
| Nested Class Summary | |
|---|---|
static interface |
VirtualSocket.DisconnectListener
|
protected class |
VirtualSocket.PendingClose
|
| Field Summary | |
|---|---|
protected static java.lang.Thread |
closingThread
|
protected static org.jboss.logging.Logger |
log
|
| Constructor Summary | |
|---|---|
VirtualSocket()
|
|
VirtualSocket(java.net.InetAddress address,
int port)
|
|
VirtualSocket(java.net.InetAddress host,
int port,
boolean stream)
|
|
VirtualSocket(java.net.InetAddress address,
int port,
java.net.InetAddress localAddr,
int localPort)
|
|
VirtualSocket(MultiplexingManager manager,
SocketId remoteSocketId)
|
|
VirtualSocket(java.net.SocketImpl impl)
|
|
VirtualSocket(java.lang.String host,
int port)
|
|
VirtualSocket(java.lang.String host,
int port,
boolean stream)
|
|
VirtualSocket(java.lang.String host,
int port,
java.net.InetAddress localAddr,
int localPort)
|
|
| Method Summary | |
|---|---|
void |
addDisconnectListener(VirtualSocket.DisconnectListener listener)
|
void |
bind(java.net.SocketAddress address)
Binds the socket to a local address. |
void |
close()
|
void |
connect(java.net.SocketAddress socketAddress)
Connects this socket to the server. |
void |
connect(java.net.SocketAddress socketAddress,
int timeout)
Connects this socket to the server with a specified timeout value. |
void |
connect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
int timeout)
|
protected void |
doClose()
|
protected java.net.Socket |
getActualSocket()
|
java.nio.channels.SocketChannel |
getChannel()
|
java.net.InetAddress |
getInetAddress()
|
java.io.InputStream |
getInputStream()
|
boolean |
getKeepAlive()
|
java.net.InetAddress |
getLocalAddress()
Note. |
int |
getLocalPort()
|
java.net.SocketAddress |
getLocalSocketAddress()
|
SocketId |
getLocalSocketId()
|
int |
getLocalVirtualPort()
|
protected MultiplexingManager |
getManager()
|
MultiplexingManager |
getMultiplexingManager()
|
boolean |
getOOBInline()
|
java.io.OutputStream |
getOutputStream()
|
int |
getPort()
|
protected Protocol |
getProtocol()
|
int |
getReceiveBufferSize()
|
java.net.SocketAddress |
getRemoteSocketAddress()
|
SocketId |
getRemoteSocketId()
|
boolean |
getReuseAddress()
|
int |
getSendBufferSize()
|
javax.net.SocketFactory |
getSocketFactory()
|
int |
getSoLinger()
|
int |
getSoTimeout()
|
boolean |
getTcpNoDelay()
|
int |
getTrafficClass()
|
int |
getVirtualPort()
|
protected void |
handleRemoteDisconnect()
|
protected void |
handleRemoteOutputShutDown()
FIXME Comment this |
protected boolean |
hasReceivedDisconnectMessage()
|
boolean |
isBound()
|
boolean |
isClosed()
Returns the closed state of the socket. |
boolean |
isConnected()
Returns the connected state of the socket. |
boolean |
isInputShutdown()
Returns whether the read-half of the socket connection is closed. |
boolean |
isOutputShutdown()
Returns whether the write-half of the socket connection is closed. |
void |
removeDisconnectListener(VirtualSocket.DisconnectListener listener)
|
void |
sendUrgentData(int data)
|
protected void |
setActualSocket(java.net.Socket actualSocket)
|
protected void |
setBound(boolean bound)
|
protected void |
setClosed(boolean closed)
|
protected void |
setConnected(boolean connected)
|
protected void |
setInputShutdown(boolean inputShutdown)
|
protected void |
setInputStream(MultiplexingInputStream inputStream)
|
void |
setKeepAlive(boolean on)
|
protected void |
setLocalSocketId(SocketId localSocketId)
|
protected void |
setManager(MultiplexingManager manager)
|
void |
setOOBInline(boolean on)
|
protected void |
setOutputShutdown(boolean outputShutdown)
|
protected void |
setOutputStream(MultiplexingOutputStream outputStream)
|
protected void |
setProtocol(Protocol protocol)
|
void |
setReceiveBufferSize(int size)
|
protected void |
setReceivedDisconnectMessage(boolean receivedDisconnectMessage)
|
protected void |
setRemoteSocketId(SocketId remoteSocketId)
|
void |
setReuseAddress(boolean on)
|
void |
setSendBufferSize(int size)
|
void |
setSocketFactory(javax.net.SocketFactory socketFactory)
|
void |
setSoLinger(boolean on,
int linger)
|
void |
setSoTimeout(int timeout)
|
void |
setTcpNoDelay(boolean on)
|
void |
setTrafficClass(int tc)
|
void |
shutdownInput()
|
void |
shutdownOutput()
|
| Methods inherited from class java.net.Socket |
|---|
setPerformancePreferences, setSocketImplFactory, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final org.jboss.logging.Logger log
protected static java.lang.Thread closingThread
| Constructor Detail |
|---|
public VirtualSocket(MultiplexingManager manager,
SocketId remoteSocketId)
throws java.io.IOException
java.io.IOExceptionpublic VirtualSocket()
public VirtualSocket(java.lang.String host,
int port)
throws java.net.UnknownHostException,
java.io.IOException
java.net.UnknownHostException
java.io.IOException
public VirtualSocket(java.lang.String host,
int port,
boolean stream)
throws java.io.IOException
host - port - stream -
java.io.IOException
public VirtualSocket(java.net.InetAddress address,
int port)
throws java.io.IOException
address - port -
java.io.IOException
public VirtualSocket(java.net.InetAddress host,
int port,
boolean stream)
throws java.io.IOException
host - port - stream -
java.io.IOException
public VirtualSocket(java.net.SocketImpl impl)
throws java.net.SocketException
impl -
java.net.SocketException
public VirtualSocket(java.lang.String host,
int port,
java.net.InetAddress localAddr,
int localPort)
throws java.io.IOException
host - port - localAddr - localPort -
java.io.IOException
public VirtualSocket(java.net.InetAddress address,
int port,
java.net.InetAddress localAddr,
int localPort)
throws java.io.IOException
address - port - localAddr - localPort -
java.io.IOException| Method Detail |
|---|
public void bind(java.net.SocketAddress address)
throws java.io.IOException
If the address is null, then the system will pick up
an ephemeral port and a valid local address to bind the socket.
TODO: security
bind in class java.net.Socketaddress - the SocketAddress to bind to
java.io.IOException - if the bind operation fails, or if the socket is already bound.
java.lang.IllegalArgumentException - if bindpoint is a
SocketAddress subclass not supported by this socket
public void close()
throws java.io.IOException
close in class java.net.Socketjava.io.IOException
public void connect(java.net.SocketAddress socketAddress)
throws java.io.IOException
connect in class java.net.SocketsocketAddress - the SocketAddress
java.io.IOException - if an error occurs during the connection
java.lang.IllegalArgumentException - if endpoint is null or is a
SocketAddress subclass not supported by this socket
public void connect(java.net.SocketAddress socketAddress,
int timeout)
throws java.io.IOException
connect in class java.net.SocketsocketAddress - the SocketAddresstimeout - the timeout value to be used in milliseconds.
java.io.IOException - if an error occurs during the connection
java.net.SocketTimeoutException - if timeout expires before connecting
java.lang.IllegalArgumentException - if endpoint is null or is a
SocketAddress subclass not supported by this socketpublic java.nio.channels.SocketChannel getChannel()
getChannel in class java.net.Socketpublic java.net.InetAddress getInetAddress()
getInetAddress in class java.net.Socket
public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in class java.net.Socketjava.io.IOException
public boolean getKeepAlive()
throws java.net.SocketException
getKeepAlive in class java.net.Socketjava.net.SocketExceptionpublic java.net.InetAddress getLocalAddress()
getLocalAddress in class java.net.Socketpublic int getLocalPort()
getLocalPort in class java.net.Socketpublic java.net.SocketAddress getLocalSocketAddress()
getLocalSocketAddress in class java.net.Socket
public boolean getOOBInline()
throws java.net.SocketException
getOOBInline in class java.net.Socketjava.net.SocketException
public java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in class java.net.Socketjava.io.IOExceptionpublic int getPort()
getPort in class java.net.Socket
public int getReceiveBufferSize()
throws java.net.SocketException
getReceiveBufferSize in class java.net.Socketjava.net.SocketExceptionpublic java.net.SocketAddress getRemoteSocketAddress()
getRemoteSocketAddress in class java.net.Socket
public boolean getReuseAddress()
throws java.net.SocketException
getReuseAddress in class java.net.Socketjava.net.SocketException
public int getSendBufferSize()
throws java.net.SocketException
getSendBufferSize in class java.net.Socketjava.net.SocketException
public int getSoLinger()
throws java.net.SocketException
getSoLinger in class java.net.Socketjava.net.SocketException
public int getSoTimeout()
throws java.net.SocketException
getSoTimeout in class java.net.Socketjava.net.SocketException
public boolean getTcpNoDelay()
throws java.net.SocketException
getTcpNoDelay in class java.net.Socketjava.net.SocketException
public int getTrafficClass()
throws java.net.SocketException
getTrafficClass in class java.net.Socketjava.net.SocketExceptionpublic boolean isBound()
isBound in class java.net.Socketpublic boolean isClosed()
isClosed in class java.net.Socketpublic boolean isConnected()
isConnected in class java.net.Socketpublic boolean isInputShutdown()
isInputShutdown in class java.net.Socketpublic boolean isOutputShutdown()
isOutputShutdown in class java.net.Socket
public void sendUrgentData(int data)
throws java.io.IOException
sendUrgentData in class java.net.Socketjava.io.IOException
public void setKeepAlive(boolean on)
throws java.net.SocketException
setKeepAlive in class java.net.Socketjava.net.SocketException
public void setOOBInline(boolean on)
throws java.net.SocketException
setOOBInline in class java.net.Socketjava.net.SocketException
public void setReceiveBufferSize(int size)
throws java.net.SocketException
setReceiveBufferSize in class java.net.Socketjava.net.SocketException
public void setReuseAddress(boolean on)
throws java.net.SocketException
setReuseAddress in class java.net.Socketjava.net.SocketException
public void setSendBufferSize(int size)
throws java.net.SocketException
setSendBufferSize in class java.net.Socketjava.net.SocketException
public void setSoLinger(boolean on,
int linger)
throws java.net.SocketException
setSoLinger in class java.net.Socketjava.net.SocketException
public void setSoTimeout(int timeout)
throws java.net.SocketException
setSoTimeout in class java.net.Socketjava.net.SocketException
public void setTcpNoDelay(boolean on)
throws java.net.SocketException
setTcpNoDelay in class java.net.Socketjava.net.SocketException
public void setTrafficClass(int tc)
throws java.net.SocketException
setTrafficClass in class java.net.Socketjava.net.SocketException
public void shutdownInput()
throws java.io.IOException
shutdownInput in class java.net.Socketjava.io.IOException
public void shutdownOutput()
throws java.io.IOException
shutdownOutput in class java.net.Socketjava.io.IOExceptionpublic void addDisconnectListener(VirtualSocket.DisconnectListener listener)
public void connect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
int timeout)
throws java.io.IOException
java.io.IOExceptionpublic MultiplexingManager getMultiplexingManager()
public int getVirtualPort()
public int getLocalVirtualPort()
public SocketId getLocalSocketId()
public SocketId getRemoteSocketId()
public javax.net.SocketFactory getSocketFactory()
public void removeDisconnectListener(VirtualSocket.DisconnectListener listener)
listener - public void setSocketFactory(javax.net.SocketFactory socketFactory)
socketFactory - protected java.net.Socket getActualSocket()
protected void setActualSocket(java.net.Socket actualSocket)
actualSocket - The actualSocket to set.protected void setBound(boolean bound)
bound - The bound to set.protected void setClosed(boolean closed)
closed - The closed to set.protected void setConnected(boolean connected)
connected - The connected to set.protected void setInputShutdown(boolean inputShutdown)
inputShutdown - The inputShutdown to set.protected void setInputStream(MultiplexingInputStream inputStream)
inputStream - The inputStream to set.protected void setLocalSocketId(SocketId localSocketId)
localSocketId - The localSocketId to set.protected MultiplexingManager getManager()
protected void setManager(MultiplexingManager manager)
manager - The manager to set.protected void setOutputShutdown(boolean outputShutdown)
outputShutdown - The outputShutdown to set.protected void setOutputStream(MultiplexingOutputStream outputStream)
outputStream - The outputStream to set.protected Protocol getProtocol()
protected void setProtocol(Protocol protocol)
protocol - The protocol to set.protected boolean hasReceivedDisconnectMessage()
protected void setReceivedDisconnectMessage(boolean receivedDisconnectMessage)
receivedDisconnectMessage - protected void setRemoteSocketId(SocketId remoteSocketId)
remoteSocketId - The remoteSocketId to set.protected void doClose()
protected void handleRemoteOutputShutDown()
throws java.io.IOException
java.io.IOException
protected void handleRemoteDisconnect()
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||