public abstract class VirtualSocket extends Socket
Modifier and Type | Field and Description |
---|---|
protected int |
_connectionId
Real socket connection id (assigned on server)
|
protected int |
_id
unique identifer (assigned by MultiplexerSocketController)
|
protected Object |
_lockObject
Lock used when waiting to perform a read on the real socket.
|
protected String |
_serverSocketName
Name of server socket.
|
Modifier | Constructor and Description |
---|---|
protected |
VirtualSocket(int connectionId,
int id,
String serverSocketName)
Called by MultiplexerSocketController when creating a new socket or receiving a command to create
a new virtual socket.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
close(boolean bSendCommand) |
protected void |
createInputStream()
Implement an inputStream that will use/share/multiplex the "real" socket.
|
protected void |
createOutputStream()
Implement an outputStream that will use/share/multiplex the "real" socket.
|
int |
getConnectionId()
The ID that is assigned on the server to the real socket connection.
|
int |
getId()
The ID that is assigned by MultiplexerSocketController.
|
InputStream |
getInputStream() |
OutputStream |
getOutputStream() |
String |
getServerSocketName() |
int |
getTimeoutSeconds() |
abstract int |
read() |
abstract int |
read(byte[] bs,
int off,
int len)
Used so that the real socket is used for the vsocket read.
|
void |
setTimeoutSeconds(int x) |
abstract void |
write(byte[] bs,
int off,
int len)
Used so that the real socket is used for the vsocket write.
|
abstract void |
write(int b) |
bind, close, connect, connect, getChannel, getInetAddress, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setSoLinger, setSoTimeout, setTcpNoDelay, setTrafficClass, shutdownInput, shutdownOutput, toString
protected final int _connectionId
protected final int _id
protected String _serverSocketName
protected final Object _lockObject
protected VirtualSocket(int connectionId, int id, String serverSocketName)
id
- seq number assigned by MultiplexerSocketController.protected void createInputStream()
public InputStream getInputStream() throws IOException
getInputStream
in class Socket
IOException
protected void createOutputStream()
public OutputStream getOutputStream() throws IOException
getOutputStream
in class Socket
IOException
public int getConnectionId()
public int getId()
public String getServerSocketName()
public abstract int read(byte[] bs, int off, int len) throws IOException
IOException
public abstract int read() throws IOException
IOException
public abstract void write(byte[] bs, int off, int len) throws IOException
IOException
public abstract void write(int b) throws IOException
IOException
public abstract void close(boolean bSendCommand) throws IOException
IOException
public void setTimeoutSeconds(int x)
public int getTimeoutSeconds()
Copyright © 1999–2019 ViaOA. All rights reserved.