public class ReconnectingSocket extends Object
| Constructor and Description |
|---|
ReconnectingSocket(InetSocketAddress address,
SocketFactory socketFactory,
WavefrontSdkMetricsRegistry sdkMetricsRegistry,
String entityPrefix)
Attempts to open a connected socket to the specified address.
|
ReconnectingSocket(String host,
int port,
SocketFactory socketFactory,
WavefrontSdkMetricsRegistry sdkMetricsRegistry,
String entityPrefix)
Attempts to open a connected socket to the specified host and port.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush()
Flushes the outputStream best-effort.
|
void |
write(String message)
Try to send the given message.
|
public ReconnectingSocket(String host, int port, SocketFactory socketFactory, WavefrontSdkMetricsRegistry sdkMetricsRegistry, String entityPrefix) throws IOException
host - The name of the remote host.port - The remote port.socketFactory - The SocketFactory used to create the underlying socket.sdkMetricsRegistry - The WavefrontSdkMetricsRegistry for internal metrics.entityPrefix - A prefix for internal metrics pertaining to this instance.IOException - When we cannot open the remote socket.public ReconnectingSocket(InetSocketAddress address, SocketFactory socketFactory, WavefrontSdkMetricsRegistry sdkMetricsRegistry, String entityPrefix) throws IOException
address - The InetSocketAddress of the server to connect to.socketFactory - The SocketFactory used to create the underlying socket.sdkMetricsRegistry - The WavefrontSdkMetricsRegistry for internal metrics.entityPrefix - A prefix for internal metrics pertaining to this instance.IOException - When we cannot open the remote socket.public void write(String message) throws Exception
Exception - when a single retry is not enough to have a successful write to
the remote host.public void flush()
throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionCopyright © 2020. All rights reserved.