in src/main/java/com/uber/rss/clients/ClientBase.java [89:131]
public void close() {
if (socket == null) {
return;
}
try {
if (outputStream != null) {
outputStream.flush();
}
} catch (Throwable e) {
logger.warn("Hit exception when flushing output stream: " + connectionInfo, e);
}
try {
if (outputStream != null) {
outputStream.close();
}
} catch (Throwable e) {
logger.warn("Hit exception when closing output stream: " + connectionInfo, e);
}
try {
if (inputStream != null) {
inputStream.close();
}
} catch (Throwable e) {
logger.warn("Hit exception when closing input stream: " + connectionInfo, e);
}
try {
socket.close();
} catch (Throwable e) {
logger.warn("Hit exception when closing socket: " + connectionInfo, e);
}
try {
metricGroupContainer.removeMetricGroup(getClientConnectMetricsKey());
} catch (Throwable e) {
logger.warn("Hit exception when removing metrics: " + connectionInfo, e);
}
socket = null;
}