public interface HttpConnection
extends java.io.Closeable
| 限定符和类型 | 方法和说明 |
|---|---|
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 在接口中 java.lang.AutoCloseableclose 在接口中 java.io.Closeablejava.io.IOExceptionboolean 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.IOExceptionHttpConnectionMetrics getMetrics()