package org.jboss.remoting.transport.multiplex;
import org.jboss.logging.Logger;
VirtualSocket
represents an endpoint on a virtual connection created by the
Multiplex system. It extends
java.net.Socket
and reimplements nearly all of
the methods in
java.net.Socket
. For information about method behavior, please
see the
java.net.Socket
javadoc. For more information about the nature of
virtual sockets, please see the Multiplex documentation at the labs.jboss.org
web site.
Copyright (c) 2005
- Deprecated:
- As of release 2.4.0 the multiplex transport will no longer be actively supported.
- Author(s):
- Ron Sigal
private boolean bound = false;
private boolean closed = false;
A class that implements
DisconnectListener
can register to
be notified if the remote peer of this
VirtualSocket
has
disconnected.
log.debug("created unbound virtual socket");
See superclass javadoc.
- Parameters:
host
port
stream
- Throws:
- java.io.IOException
throw new SocketException("Deprecated: use DataGramSocket instead of stream = false");
See superclass javadoc.
- Parameters:
address
port
- Throws:
- java.io.IOException
See superclass javadoc.
- Parameters:
host
port
stream
- Throws:
- java.io.IOException
throw new SocketException("Deprecated: use DataGramSocket instead of stream = false");
This constuctor is not implemented.
- Parameters:
impl
- Throws:
- java.net.SocketException in all cases
See superclass javadoc.
- Parameters:
host
port
localAddr
localPort
- Throws:
- java.io.IOException
this(InetAddress.getByName(host), port, localAddr, localPort);
See superclass javadoc.
- Parameters:
address
port
localAddr
localPort
- Throws:
- java.io.IOException
public methods in Socket class
ok: public void connect(SocketAddress endpoint) throws IOException;
ok: public void connect(SocketAddress endpoint, int timeout) throws IOException;
ok: public void bind(SocketAddress bindpoint) throws IOException;
ok: public InetAddress getInetAddress();
ok: public InetAddress getLocalAddress();
ok: public int getPort();
ok: public int getLocalPort();
ok: public SocketAddress getRemoteSocketAddress();
ok: public SocketAddress getLocalSocketAddress();
ok: public SocketChannel getChannel();
ok: public InputStream getInputStream() throws IOException;
ok: public OutputStream getOutputStream() throws IOException;
ok: public void setTcpNoDelay(boolean on) throws SocketException;
ok: public boolean getTcpNoDelay() throws SocketException;
ok: public void setSoLinger(boolean on, int linger) throws SocketException;
ok: public int getSoLinger() throws SocketException;
ok: public void sendUrgentData(int data) throws IOException;
ok: public void setOOBInline(boolean on) throws SocketException;
ok: public boolean getOOBInline() throws SocketException;
ok: public void setSoTimeout(int timeout) throws SocketException;
ok: public int getSoTimeout() throws SocketException;
ok: public void setSendBufferSize(int size) throws SocketException;
ok: public int getSendBufferSize() throws SocketException;
ok: public void setReceiveBufferSize(int size) throws SocketException;
ok: public int getReceiveBufferSize() throws SocketException;
ok: public void setKeepAlive(boolean on) throws SocketException;
ok: public boolean getKeepAlive() throws SocketException;
ok: public void setTrafficClass(int tc) throws SocketException;
ok: public int getTrafficClass() throws SocketException;
ok: public void setReuseAddress(boolean on) throws SocketException;
ok: public boolean getReuseAddress() throws SocketException;
ok: public void close() throws IOException;
ok: public void shutdownInput() throws IOException;
ok: public void shutdownOutput() throws IOException;
ok: public String toString();
ok: public boolean isConnected();
ok: public boolean isBound();
ok: public boolean isClosed();
ok: public boolean isInputShutdown();
ok: public boolean isOutputShutdown();
/
connect(socketAddress, null, timeout);
See superclass javadoc.
Note.
Socket.getLocalAddress()
returns "wildcard" address for an unbound socket.
This method is not implemented.
See superclass javadoc.
log.warn("sendUrgentData() called: ignored");
log.warn("setOOBInLine() called: ignored");
log.debug("entering connect()");
if (remoteAddress == null)
if (localAddress == null)
Returns true if and only if has not received notification of error state
on actual connection.
- Returns:
- true if and only if has not received notification of error state
on actual connection
log.error("attempt to remove unregistered DisconnectListener: " + listener);
- Returns:
- Returns the actualSocket.
- Parameters:
actualSocket
The actualSocket to set.
- Parameters:
bound
The bound to set.
- Parameters:
closed
The closed to set.
- Parameters:
connected
The connected to set.
- Parameters:
inputShutdown
The inputShutdown to set.
- Parameters:
inputStream
The inputStream to set.
- Parameters:
localSocketId
The localSocketId to set.
- Parameters:
manager
The manager to set.
- Parameters:
outputShutdown
The outputShutdown to set.
- Parameters:
outputStream
The outputStream to set.
- Returns:
- Returns the protocol.
- Parameters:
protocol
The protocol to set.
- Parameters:
receivedDisconnectMessage
- Parameters:
remoteSocketId
The remoteSocketId to set.
log.error("error closing socket: " + this);
log.debug("handleRemoteDisconnect(): done.");
Indicate error condition on actual connection.
Set disconnectListeners = vs.disconnectListeners;