| Modifier and Type | Class and Description |
|---|---|
static interface |
TcpChannelHub.Task |
| Modifier and Type | Field and Description |
|---|---|
protected net.openhft.chronicle.core.io.CloseablesManager |
closeables |
protected String |
name |
protected InetSocketAddress |
remoteAddress |
static int |
SIZE_OF_SIZE |
protected int |
tcpBufferSize |
long |
timeoutMs |
| Constructor and Description |
|---|
TcpChannelHub(SessionProvider sessionProvider,
String hostname,
int port) |
| Modifier and Type | Method and Description |
|---|---|
void |
asyncReadSocket(long tid,
java.util.function.Consumer<net.openhft.chronicle.wire.Wire> consumer)
the response comes back on the executorService thread as any work done on the consumer is
blocking any further work, for reading the socket.
|
void |
close() |
protected void |
closeExisting()
closes the existing connections and establishes a new closeables
|
SocketChannel |
lazyConnect() |
SocketChannel |
lazyConnect(long timeoutMs,
InetSocketAddress remoteAddress) |
void |
lock(TcpChannelHub.Task r) |
long |
nextUniqueTransaction(long time)
the transaction id are generated as unique timestamps
|
ReentrantLock |
outBytesLock() |
net.openhft.chronicle.wire.Wire |
outWire() |
net.openhft.chronicle.wire.Wire |
proxyReply(long timeoutTime,
long tid) |
SocketChannel |
reConnect() |
void |
startTime(long startTime) |
void |
writeAsyncHeader(net.openhft.chronicle.wire.Wire wire,
String csp,
long cid)
The writes the meta data to wire - the async version does not contain the tid
|
void |
writeMetaDataForKnownTID(long tid,
net.openhft.chronicle.wire.Wire wire,
String csp,
long cid) |
long |
writeMetaDataStartTime(long startTime,
net.openhft.chronicle.wire.Wire wire,
String csp,
long cid) |
void |
writeSocket(net.openhft.chronicle.wire.Wire wire)
sends data to the server via TCP/IP
|
public static final int SIZE_OF_SIZE
public final long timeoutMs
@NotNull protected final String name
@NotNull protected final InetSocketAddress remoteAddress
protected final int tcpBufferSize
@Nullable protected net.openhft.chronicle.core.io.CloseablesManager closeables
public TcpChannelHub(SessionProvider sessionProvider, String hostname, int port)
public void asyncReadSocket(long tid,
@NotNull
java.util.function.Consumer<net.openhft.chronicle.wire.Wire> consumer)
tid - the tid of the message to be read from the socketconsumer - its important that this is a short running task@NotNull public ReentrantLock outBytesLock()
public SocketChannel lazyConnect()
public SocketChannel reConnect()
public SocketChannel lazyConnect(long timeoutMs, InetSocketAddress remoteAddress)
protected void closeExisting()
public void close()
close in interface Closeableclose in interface AutoCloseablepublic long nextUniqueTransaction(long time)
time - in millisecondspublic void writeSocket(@NotNull
net.openhft.chronicle.wire.Wire wire)
wire - the wire containing the outbound datapublic net.openhft.chronicle.wire.Wire proxyReply(long timeoutTime,
long tid)
public net.openhft.chronicle.wire.Wire outWire()
public long writeMetaDataStartTime(long startTime,
@NotNull
net.openhft.chronicle.wire.Wire wire,
String csp,
long cid)
public void writeMetaDataForKnownTID(long tid,
@NotNull
net.openhft.chronicle.wire.Wire wire,
String csp,
long cid)
public void writeAsyncHeader(@NotNull
net.openhft.chronicle.wire.Wire wire,
String csp,
long cid)
wire - the wire that we will write tocsp - provide either the csp or the cidcid - provide either the csp or the cidpublic void startTime(long startTime)
public void lock(TcpChannelHub.Task r)
Copyright © 2015. All rights reserved.