use of org.apache.hc.core5.http.impl.BasicEndpointDetails in project httpcomponents-core by apache.
the class BHttpConnectionBase method getEndpointDetails.
@Override
public EndpointDetails getEndpointDetails() {
if (endpointDetails == null) {
final SocketHolder socketHolder = this.socketHolderRef.get();
if (socketHolder != null) {
@SuppressWarnings("resource") final Socket socket = socketHolder.getSocket();
Timeout socketTimeout;
try {
socketTimeout = Timeout.ofMilliseconds(socket.getSoTimeout());
} catch (final SocketException e) {
socketTimeout = Timeout.DISABLED;
}
endpointDetails = new BasicEndpointDetails(socket.getRemoteSocketAddress(), socket.getLocalSocketAddress(), this.connMetrics, socketTimeout);
}
}
return endpointDetails;
}
Aggregations