public interface HttpConnection
extends java.io.Closeable
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this connection gracefully.
|
HttpConnectionMetrics |
getMetrics()
Returns a collection of connection metrics.
|
int |
getSocketTimeout()
Returns the socket timeout value.
|
boolean |
isOpen()
Checks if this connection is open.
|
boolean |
isStale()
Checks whether this connection has gone down.
|
void |
setSocketTimeout(int timeout)
Sets the socket timeout value.
|
void |
shutdown()
Force-closes this connection.
|
void close() throws java.io.IOException
shutdown
instead.close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
java.io.IOException
boolean isOpen()
boolean isStale()
true
if attempts to use this connection are
likely to succeed, or false
if they are likely
to fail and this connection should be closedvoid setSocketTimeout(int timeout)
timeout
- timeout value in millisecondsint getSocketTimeout()
0
if timeout is disabled or -1
if
timeout is undefined.void shutdown() throws java.io.IOException
java.io.IOException
HttpConnectionMetrics getMetrics()