public class ReconnectingSocket
extends java.lang.Object
| Constructor and Description |
|---|
ReconnectingSocket(java.net.InetSocketAddress address,
javax.net.SocketFactory socketFactory,
WavefrontSdkMetricsRegistry sdkMetricsRegistry,
java.lang.String entityPrefix)
Attempts to open a connected socket to the specified address.
|
ReconnectingSocket(java.lang.String host,
int port,
javax.net.SocketFactory socketFactory,
WavefrontSdkMetricsRegistry sdkMetricsRegistry,
java.lang.String entityPrefix)
Attempts to open a connected socket to the specified host and port.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
close.
|
void |
flush()
Flushes the outputStream best-effort.
|
void |
write(java.lang.String message)
Try to send the given message.
|
public ReconnectingSocket(java.lang.String host,
int port,
javax.net.SocketFactory socketFactory,
WavefrontSdkMetricsRegistry sdkMetricsRegistry,
java.lang.String entityPrefix)
throws java.io.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.java.io.IOException - When we cannot open the remote socket.public ReconnectingSocket(java.net.InetSocketAddress address,
javax.net.SocketFactory socketFactory,
WavefrontSdkMetricsRegistry sdkMetricsRegistry,
java.lang.String entityPrefix)
throws java.io.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.java.io.IOException - When we cannot open the remote socket.public void write(java.lang.String message)
throws java.lang.Exception
message - a String objectjava.lang.Exception - when a single retry is not enough to have a successful write to
the remote host.public void flush()
throws java.io.IOException
java.io.IOException - if any.public void close()
throws java.io.IOException
close.
java.io.IOException - if any.Copyright © 2023. All rights reserved.