public abstract class WireTcpHandler<T extends NetworkContext<T>> extends net.openhft.chronicle.core.io.SimpleCloseable implements TcpHandler<T>, NetworkContextManager<T>
| Modifier and Type | Field and Description |
|---|---|
protected net.openhft.chronicle.wire.Wire |
outWire |
protected @Nullable net.openhft.chronicle.wire.WireType |
wireType |
| Constructor and Description |
|---|
WireTcpHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkWires(net.openhft.chronicle.bytes.Bytes<?> in,
net.openhft.chronicle.bytes.Bytes<?> out,
@NotNull net.openhft.chronicle.wire.WireType wireType) |
protected net.openhft.chronicle.wire.Wire |
initialiseInWire(@NotNull net.openhft.chronicle.wire.WireType wireType,
net.openhft.chronicle.bytes.Bytes<?> in) |
protected net.openhft.chronicle.wire.Wire |
initialiseOutWire(net.openhft.chronicle.bytes.Bytes<?> out,
@NotNull net.openhft.chronicle.wire.WireType wireType) |
boolean |
isAcceptor() |
void |
isAcceptor(boolean isAcceptor) |
T |
nc() |
void |
nc(T nc) |
protected void |
onBytesWritten() |
void |
onEndOfConnection(boolean heartbeatTimeOut) |
protected abstract void |
onInitialize() |
protected abstract void |
onRead(@NotNull net.openhft.chronicle.wire.DocumentContext in,
@NotNull net.openhft.chronicle.wire.WireOut out) |
protected void |
onWrite(@NotNull net.openhft.chronicle.wire.WireOut out) |
protected void |
performClose() |
void |
process(@NotNull net.openhft.chronicle.bytes.Bytes<?> in,
@NotNull net.openhft.chronicle.bytes.Bytes<?> out,
T nc)
The server reads the bytes
in from the client and sends a response out back
to the client. |
protected void |
publish(net.openhft.chronicle.wire.WriteMarshallable w) |
WireOutPublisher |
publisher() |
void |
publisher(@NotNull WireOutPublisher publisher) |
net.openhft.chronicle.wire.WireType |
wireType()
Process an incoming request
|
void |
wireType(@NotNull net.openhft.chronicle.wire.WireType wireType) |
protected void |
writeData(boolean isNotComplete,
@NotNull net.openhft.chronicle.bytes.Bytes<?> inBytes,
@NotNull net.openhft.chronicle.wire.WriteMarshallable c)
write and exceptions and rolls back if no data was written
|
protected void |
writeData(@NotNull net.openhft.chronicle.bytes.Bytes<?> inBytes,
@NotNull net.openhft.chronicle.wire.WriteMarshallable c)
write and exceptions and rolls back if no data was written
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasTimedOut, onReadTime, onWriteTime, performIdleWork, sendHeartBeathasClientClosedclose, closeQuietly, closeQuietlyprotected net.openhft.chronicle.wire.Wire outWire
@Nullable protected @Nullable net.openhft.chronicle.wire.WireType wireType
public boolean isAcceptor()
public void wireType(@NotNull
@NotNull net.openhft.chronicle.wire.WireType wireType)
public WireOutPublisher publisher()
public void publisher(@NotNull
@NotNull WireOutPublisher publisher)
public void isAcceptor(boolean isAcceptor)
public void process(@NotNull
@NotNull net.openhft.chronicle.bytes.Bytes<?> in,
@NotNull
@NotNull net.openhft.chronicle.bytes.Bytes<?> out,
T nc)
TcpHandlerin from the client and sends a response out back
to the client.process in interface TcpHandler<T extends NetworkContext<T>>in - the bytes send from the clientout - the response send back to the clientprotected void onBytesWritten()
public void onEndOfConnection(boolean heartbeatTimeOut)
onEndOfConnection in interface TcpHandler<T extends NetworkContext<T>>protected void onWrite(@NotNull
@NotNull net.openhft.chronicle.wire.WireOut out)
protected void checkWires(net.openhft.chronicle.bytes.Bytes<?> in,
net.openhft.chronicle.bytes.Bytes<?> out,
@NotNull
@NotNull net.openhft.chronicle.wire.WireType wireType)
protected net.openhft.chronicle.wire.Wire initialiseOutWire(net.openhft.chronicle.bytes.Bytes<?> out,
@NotNull
@NotNull net.openhft.chronicle.wire.WireType wireType)
protected net.openhft.chronicle.wire.Wire initialiseInWire(@NotNull
@NotNull net.openhft.chronicle.wire.WireType wireType,
net.openhft.chronicle.bytes.Bytes<?> in)
public net.openhft.chronicle.wire.WireType wireType()
protected abstract void onRead(@NotNull
@NotNull net.openhft.chronicle.wire.DocumentContext in,
@NotNull
@NotNull net.openhft.chronicle.wire.WireOut out)
in - the wire to be processedout - the result of processing the inprotected void writeData(@NotNull
@NotNull net.openhft.chronicle.bytes.Bytes<?> inBytes,
@NotNull
@NotNull net.openhft.chronicle.wire.WriteMarshallable c)
protected void writeData(boolean isNotComplete,
@NotNull
@NotNull net.openhft.chronicle.bytes.Bytes<?> inBytes,
@NotNull
@NotNull net.openhft.chronicle.wire.WriteMarshallable c)
public final void nc(T nc)
nc in interface NetworkContextManager<T extends NetworkContext<T>>public T nc()
nc in interface NetworkContextManager<T extends NetworkContext<T>>protected abstract void onInitialize()
protected void performClose()
performClose in class net.openhft.chronicle.core.io.SimpleCloseableprotected void publish(net.openhft.chronicle.wire.WriteMarshallable w)
Copyright © 2023. All rights reserved.