public interface ConnectionStrategy extends net.openhft.chronicle.wire.Marshallable, Closeable
| Modifier and Type | Method and Description |
|---|---|
default ClientConnectionMonitor |
clientConnectionMonitor() |
default void |
close() |
ChronicleSocketChannel |
connect(@NotNull String name,
@NotNull SocketAddressSupplier socketAddressSupplier,
boolean didLogIn,
@NotNull FatalFailureMonitor fatalFailureMonitor)
Connects and returns a new SocketChannel.
|
default boolean |
isClosed() |
default @Nullable InetSocketAddress |
localSocketBinding()
Get the local socket to bind the connection to
|
default long |
maxPauseSec() |
default long |
minPauseSec() |
default ConnectionStrategy |
open() |
default @Nullable ChronicleSocketChannel |
openSocketChannel(@NotNull InetSocketAddress socketAddress,
int tcpBufferSize,
long timeoutMs) |
default @Nullable ChronicleSocketChannel |
openSocketChannel(@NotNull InetSocketAddress socketAddress,
int tcpBufferSize,
long timeoutMs,
int socketConnectionTimeoutMs)
the reason for this method is that unlike the selector it uses tick time
|
default void |
pauseBeforeReconnect(long startMs) |
default long |
pauseMillisBeforeReconnect()
allows control of a backoff strategy
|
static @Nullable ChronicleSocketChannel |
socketChannel(@NotNull InetSocketAddress socketAddress,
int tcpBufferSize,
int socketConnectionTimeoutMs)
Deprecated.
|
default void |
throwExceptionIfClosed() |
$equals, $fieldInfoMap, $fieldInfos, $hashCode, $toString, className, copyTo, deepCopy, fromFile, fromFile, fromString, fromString, fromString, getField, getLongField, mergeToMap, readMarshallable, reset, setField, setLongField, streamFromFile, streamFromFile, writeMarshallabledefault ClientConnectionMonitor clientConnectionMonitor()
@Deprecated @Nullable static @Nullable ChronicleSocketChannel socketChannel(@NotNull @NotNull InetSocketAddress socketAddress, int tcpBufferSize, int socketConnectionTimeoutMs) throws IOException
ChronicleSocketChannel.builder(InetSocketAddress) insteadIOExceptionChronicleSocketChannel connect(@NotNull @NotNull String name, @NotNull @NotNull SocketAddressSupplier socketAddressSupplier, boolean didLogIn, @NotNull @NotNull FatalFailureMonitor fatalFailureMonitor) throws InterruptedException
name - the name of the connection, only used for loggingsocketAddressSupplier - to use for addressdidLogIn - was the last attempt successful, was a login establishedfatalFailureMonitor - this is invoked on failuresInterruptedException - if the channel is interrupted.@Nullable default @Nullable ChronicleSocketChannel openSocketChannel(@NotNull @NotNull InetSocketAddress socketAddress, int tcpBufferSize, long timeoutMs) throws IOException, InterruptedException
IOExceptionInterruptedException@Nullable default @Nullable ChronicleSocketChannel openSocketChannel(@NotNull @NotNull InetSocketAddress socketAddress, int tcpBufferSize, long timeoutMs, int socketConnectionTimeoutMs) throws IOException, InterruptedException
IOExceptionInterruptedExceptiondefault void pauseBeforeReconnect(long startMs)
default long pauseMillisBeforeReconnect()
default void close()
close in interface AutoCloseableclose in interface Closeabledefault boolean isClosed()
default ConnectionStrategy open()
default void throwExceptionIfClosed()
throws IllegalStateException
IllegalStateExceptiondefault long minPauseSec()
default long maxPauseSec()
@Nullable default @Nullable InetSocketAddress localSocketBinding() throws SocketException, UnknownHostException, IllegalStateException
SocketException - If an I/O error occursUnknownHostException - If an adddress cannot be resolvedIllegalStateException - If a hostname or interface has no matching addressesCopyright © 2023. All rights reserved.