use of kieker.monitoring.writer.tcp.ConnectionTimeoutException in project iobserve-analysis by research-iobserve.
the class TcpProbeController method createNewTcpWriter.
private SingleSocketTcpWriter createNewTcpWriter(final String hostname, final int port) throws RemoteControlFailedException {
final Configuration configuration = new Configuration();
configuration.setProperty(SingleSocketTcpWriter.CONFIG_HOSTNAME, hostname);
configuration.setProperty(SingleSocketTcpWriter.CONFIG_PORT, port);
configuration.setProperty(SingleSocketTcpWriter.CONFIG_CONN_TIMEOUT_IN_MS, TcpProbeController.CONN_TIMEOUT_IN_MS);
configuration.setProperty(SingleSocketTcpWriter.CONFIG_FLUSH, true);
configuration.setProperty(SingleSocketTcpWriter.CONFIG_BUFFERSIZE, 65535);
final SingleSocketTcpWriter tcpWriter;
try {
tcpWriter = new SingleSocketTcpWriter(configuration);
tcpWriter.onStarting();
} catch (final IOException | ConnectionTimeoutException e) {
// runtime exception is thrown after timeout
if (TcpProbeController.LOGGER.isDebugEnabled()) {
TcpProbeController.LOGGER.debug("Could not create TCP connections to " + hostname + " on port " + port, e);
}
throw new RemoteControlFailedException("Could not create TCP connections to " + hostname + " on port " + port + ", writer was not created ");
}
return tcpWriter;
}
Aggregations