in src/main/java/software/amazon/cloudwatchlogs/emf/sinks/TCPClient.java [53:73]
public synchronized void sendMessage(String message) {
if (socket == null || socket.isClosed() || shouldConnect) {
connect();
}
OutputStream os;
try {
os = socket.getOutputStream();
} catch (IOException e) {
shouldConnect = true;
throw new RuntimeException(
"Failed to write message to the socket. Failed to open output stream.", e);
}
try {
os.write(message.getBytes());
} catch (Exception e) {
shouldConnect = true;
throw new RuntimeException("Failed to write message to the socket.", e);
}
}