You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2018/08/04 16:47:49 UTC
[2/5] httpcomponents-core git commit: Refactor timeout APIs to
include the scale in the method name;
for example 'int getSocketTimeout()' -> int 'getSocketTimeoutMillis()'.
Refactor timeout APIs to include the scale in the method name; for
example 'int getSocketTimeout()' -> int 'getSocketTimeoutMillis()'.
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/3af89cc7
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/3af89cc7
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/3af89cc7
Branch: refs/heads/api_javadocs
Commit: 3af89cc77028a240e6f685ff8c2ceca4c7cd9356
Parents: d01b7ec
Author: Gary Gregory <gg...@apache.org>
Authored: Sat Aug 4 08:42:13 2018 -0600
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Sat Aug 4 17:27:47 2018 +0200
----------------------------------------------------------------------
.../impl/nio/AbstractHttp2StreamMultiplexer.java | 6 +++---
.../http2/impl/nio/ClientHttpProtocolNegotiator.java | 4 ++--
.../impl/nio/Http2OnlyClientProtocolNegotiator.java | 4 ++--
.../http2/impl/nio/ServerHttpProtocolNegotiator.java | 4 ++--
.../apache/hc/core5/http2/nio/pool/H2ConnPool.java | 6 +++---
.../apache/hc/core5/benchmark/BenchmarkWorker.java | 6 +++---
.../apache/hc/core5/benchmark/CommandLineUtils.java | 2 +-
.../java/org/apache/hc/core5/benchmark/Config.java | 4 ++--
.../apache/hc/core5/testing/nio/LoggingIOSession.java | 8 ++++----
.../hc/core5/testing/nio/Http1IntegrationTest.java | 2 +-
.../org/apache/hc/core5/http/config/H1Config.java | 14 +++++++-------
.../core5/http/impl/bootstrap/HttpAsyncRequester.java | 2 +-
.../http/impl/nio/AbstractHttp1StreamDuplexer.java | 14 +++++++-------
.../http/impl/nio/ClientHttp1StreamDuplexer.java | 4 ++--
.../core5/http/impl/nio/ClientHttp1StreamHandler.java | 2 +-
.../http/impl/nio/ServerHttp1StreamDuplexer.java | 4 ++--
.../java/org/apache/hc/core5/reactor/IOSession.java | 4 ++--
.../org/apache/hc/core5/reactor/IOSessionImpl.java | 4 ++--
.../apache/hc/core5/reactor/InternalDataChannel.java | 10 +++++-----
.../apache/hc/core5/reactor/SingleCoreIOReactor.java | 4 ++--
.../org/apache/hc/core5/reactor/ssl/SSLIOSession.java | 12 ++++++------
21 files changed, 60 insertions(+), 60 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java
----------------------------------------------------------------------
diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java
index 6d73284..56808e8 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java
@@ -1207,7 +1207,7 @@ abstract class AbstractHttp2StreamMultiplexer implements Identifiable, HttpConne
@Override
public void setSocketTimeoutMillis(final int timeout) {
- ioSession.setSocketTimeout(timeout);
+ ioSession.setSocketTimeoutMillis(timeout);
}
@Override
@@ -1220,14 +1220,14 @@ abstract class AbstractHttp2StreamMultiplexer implements Identifiable, HttpConne
public EndpointDetails getEndpointDetails() {
if (endpointDetails == null) {
endpointDetails = new BasicEndpointDetails(ioSession.getRemoteAddress(),
- ioSession.getLocalAddress(), connMetrics, ioSession.getSocketTimeout());
+ ioSession.getLocalAddress(), connMetrics, ioSession.getSocketTimeoutMillis());
}
return endpointDetails;
}
@Override
public int getSocketTimeoutMillis() {
- return ioSession.getSocketTimeout();
+ return ioSession.getSocketTimeoutMillis();
}
@Override
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ClientHttpProtocolNegotiator.java
----------------------------------------------------------------------
diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ClientHttpProtocolNegotiator.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ClientHttpProtocolNegotiator.java
index 62d3d1d..4213ccf 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ClientHttpProtocolNegotiator.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ClientHttpProtocolNegotiator.java
@@ -219,12 +219,12 @@ public class ClientHttpProtocolNegotiator implements HttpConnectionEventHandler
@Override
public void setSocketTimeoutMillis(final int timeout) {
- ioSession.setSocketTimeout(timeout);
+ ioSession.setSocketTimeoutMillis(timeout);
}
@Override
public int getSocketTimeoutMillis() {
- return ioSession.getSocketTimeout();
+ return ioSession.getSocketTimeoutMillis();
}
@Override
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/Http2OnlyClientProtocolNegotiator.java
----------------------------------------------------------------------
diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/Http2OnlyClientProtocolNegotiator.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/Http2OnlyClientProtocolNegotiator.java
index 286ec02..7d4e6ac 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/Http2OnlyClientProtocolNegotiator.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/Http2OnlyClientProtocolNegotiator.java
@@ -191,12 +191,12 @@ public class Http2OnlyClientProtocolNegotiator implements HttpConnectionEventHan
@Override
public void setSocketTimeoutMillis(final int timeout) {
- ioSession.setSocketTimeout(timeout);
+ ioSession.setSocketTimeoutMillis(timeout);
}
@Override
public int getSocketTimeoutMillis() {
- return ioSession.getSocketTimeout();
+ return ioSession.getSocketTimeoutMillis();
}
@Override
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerHttpProtocolNegotiator.java
----------------------------------------------------------------------
diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerHttpProtocolNegotiator.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerHttpProtocolNegotiator.java
index 18c70d9..87891bd 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerHttpProtocolNegotiator.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerHttpProtocolNegotiator.java
@@ -187,12 +187,12 @@ public class ServerHttpProtocolNegotiator implements HttpConnectionEventHandler
@Override
public void setSocketTimeoutMillis(final int timeout) {
- ioSession.setSocketTimeout(timeout);
+ ioSession.setSocketTimeoutMillis(timeout);
}
@Override
public int getSocketTimeoutMillis() {
- return ioSession.getSocketTimeout();
+ return ioSession.getSocketTimeoutMillis();
}
@Override
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/pool/H2ConnPool.java
----------------------------------------------------------------------
diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/pool/H2ConnPool.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/pool/H2ConnPool.java
index 78098e7..a18552f 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/pool/H2ConnPool.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/pool/H2ConnPool.java
@@ -111,7 +111,7 @@ public final class H2ConnPool extends AbstractIOSessionPool<HttpHost> {
ioSession.getLocalAddress(),
ioSession.getRemoteAddress(),
null);
- ioSession.setSocketTimeout(requestTimeout.toMillisIntBound());
+ ioSession.setSocketTimeoutMillis(requestTimeout.toMillisIntBound());
}
callback.completed(ioSession);
}
@@ -138,12 +138,12 @@ public final class H2ConnPool extends AbstractIOSessionPool<HttpHost> {
final long lastAccessTime = Math.min(ioSession.getLastReadTime(), ioSession.getLastWriteTime());
final long deadline = lastAccessTime + timeValue.toMillis();
if (deadline <= System.currentTimeMillis()) {
- final int socketTimeout = ioSession.getSocketTimeout();
+ final int socketTimeoutMillis = ioSession.getSocketTimeoutMillis();
ioSession.enqueue(new PingCommand(new BasicPingHandler(new Callback<Boolean>() {
@Override
public void execute(final Boolean result) {
- ioSession.setSocketTimeout(socketTimeout);
+ ioSession.setSocketTimeoutMillis(socketTimeoutMillis);
callback.execute(result);
}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/BenchmarkWorker.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/BenchmarkWorker.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/BenchmarkWorker.java
index 5c1979e..4715bc5 100644
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/BenchmarkWorker.java
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/BenchmarkWorker.java
@@ -142,9 +142,9 @@ class BenchmarkWorker implements Runnable {
socket = new Socket();
}
- final int timeout = config.getSocketTimeout();
- socket.setSoTimeout(timeout);
- socket.connect(new InetSocketAddress(hostname, port), timeout);
+ final int timeoutMillis = config.getSocketTimeoutMillis();
+ socket.setSoTimeout(timeoutMillis);
+ socket.connect(new InetSocketAddress(hostname, port), timeoutMillis);
conn.bind(socket);
}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/CommandLineUtils.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/CommandLineUtils.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/CommandLineUtils.java
index b36b0d1..acdb785 100644
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/CommandLineUtils.java
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/CommandLineUtils.java
@@ -187,7 +187,7 @@ public class CommandLineUtils {
if (cmd.hasOption('t')) {
final String t = cmd.getOptionValue('t');
try {
- config.setSocketTimeout(Integer.parseInt(t));
+ config.setSocketTimeoutMillis(Integer.parseInt(t));
} catch (final NumberFormatException ex) {
printError("Invalid socket timeout: " + t);
}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/Config.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/Config.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/Config.java
index 9388618..d8a346b 100644
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/Config.java
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/Config.java
@@ -153,11 +153,11 @@ public class Config {
this.headers = headers;
}
- public int getSocketTimeout() {
+ public int getSocketTimeoutMillis() {
return socketTimeout;
}
- public void setSocketTimeout(final int socketTimeout) {
+ public void setSocketTimeoutMillis(final int socketTimeout) {
this.socketTimeout = socketTimeout;
}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingIOSession.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingIOSession.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingIOSession.java
index bc66fa0..43e5ebc 100644
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingIOSession.java
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingIOSession.java
@@ -177,16 +177,16 @@ public class LoggingIOSession implements IOSession {
}
@Override
- public int getSocketTimeout() {
- return this.session.getSocketTimeout();
+ public int getSocketTimeoutMillis() {
+ return this.session.getSocketTimeoutMillis();
}
@Override
- public void setSocketTimeout(final int timeout) {
+ public void setSocketTimeoutMillis(final int timeout) {
if (this.log.isDebugEnabled()) {
this.log.debug(this.session + " Set timeout " + timeout);
}
- this.session.setSocketTimeout(timeout);
+ this.session.setSocketTimeoutMillis(timeout);
}
@Override
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1IntegrationTest.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1IntegrationTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1IntegrationTest.java
index e8810de..cc1f5ab 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1IntegrationTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1IntegrationTest.java
@@ -872,7 +872,7 @@ public class Http1IntegrationTest extends InternalHttp1ServerTestBase {
});
final InetSocketAddress serverEndpoint = server.start();
- client.start(H1Config.custom().setWaitForContinueTimeout(100).build());
+ client.start(H1Config.custom().setWaitForContinueTimeoutMillis(100).build());
final Future<ClientSessionEndpoint> connectFuture = client.connect(
"localhost", serverEndpoint.getPort(), TIMEOUT);
final ClientSessionEndpoint streamEndpoint = connectFuture.get();
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5/src/main/java/org/apache/hc/core5/http/config/H1Config.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/config/H1Config.java b/httpcore5/src/main/java/org/apache/hc/core5/http/config/H1Config.java
index 405378a..47bfb0f 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/config/H1Config.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/config/H1Config.java
@@ -45,7 +45,7 @@ public class H1Config {
private final int bufferSize;
private final int chunkSizeHint;
- private final int waitForContinueTimeout;
+ private final int waitForContinueTimeoutMillis;
private final int maxLineLength;
private final int maxHeaderCount;
private final int maxEmptyLineCount;
@@ -55,7 +55,7 @@ public class H1Config {
super();
this.bufferSize = bufferSize;
this.chunkSizeHint = chunkSizeHint;
- this.waitForContinueTimeout = waitForContinueTimeout;
+ this.waitForContinueTimeoutMillis = waitForContinueTimeout;
this.maxLineLength = maxLineLength;
this.maxHeaderCount = maxHeaderCount;
this.maxEmptyLineCount = maxEmptyLineCount;
@@ -69,8 +69,8 @@ public class H1Config {
return chunkSizeHint;
}
- public int getWaitForContinueTimeout() {
- return waitForContinueTimeout;
+ public int getWaitForContinueTimeoutMillis() {
+ return waitForContinueTimeoutMillis;
}
public int getMaxLineLength() {
@@ -90,7 +90,7 @@ public class H1Config {
final StringBuilder builder = new StringBuilder();
builder.append("[bufferSize=").append(bufferSize)
.append(", chunkSizeHint=").append(chunkSizeHint)
- .append(", waitForContinueTimeout=").append(waitForContinueTimeout)
+ .append(", waitForContinueTimeout=").append(waitForContinueTimeoutMillis)
.append(", maxLineLength=").append(maxLineLength)
.append(", maxHeaderCount=").append(maxHeaderCount)
.append(", maxEmptyLineCount=").append(maxEmptyLineCount)
@@ -107,7 +107,7 @@ public class H1Config {
return new Builder()
.setBufferSize(config.getBufferSize())
.setChunkSizeHint(config.getChunkSizeHint())
- .setWaitForContinueTimeout(config.getWaitForContinueTimeout())
+ .setWaitForContinueTimeoutMillis(config.getWaitForContinueTimeoutMillis())
.setMaxHeaderCount(config.getMaxHeaderCount())
.setMaxLineLength(config.getMaxLineLength())
.setMaxEmptyLineCount(config.maxEmptyLineCount);
@@ -141,7 +141,7 @@ public class H1Config {
return this;
}
- public Builder setWaitForContinueTimeout(final int waitForContinueTimeout) {
+ public Builder setWaitForContinueTimeoutMillis(final int waitForContinueTimeout) {
this.waitForContinueTimeout = waitForContinueTimeout;
return this;
}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/HttpAsyncRequester.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/HttpAsyncRequester.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/HttpAsyncRequester.java
index b855e6f..00ffc4a 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/HttpAsyncRequester.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/HttpAsyncRequester.java
@@ -204,7 +204,7 @@ public class HttpAsyncRequester extends AsyncRequester implements ConnPoolContro
session.getRemoteAddress(),
attachment);
}
- session.setSocketTimeout(timeout.toMillisIntBound());
+ session.setSocketTimeoutMillis(timeout.toMillisIntBound());
poolEntry.assignConnection(session);
resultFuture.completed(endpoint);
}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
index 7b603b6..21a1433 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
@@ -483,12 +483,12 @@ abstract class AbstractHttp1StreamDuplexer<IncomingMessage extends HttpMessage,
ioSession.setEvent(SelectionKey.OP_WRITE);
}
- int getSessionTimeout() {
- return ioSession.getSocketTimeout();
+ int getSessionTimeoutMillis() {
+ return ioSession.getSocketTimeoutMillis();
}
- void setSessionTimeout(final int timeout) {
- ioSession.setSocketTimeout(timeout);
+ void setSessionTimeoutMillis(final int timeout) {
+ ioSession.setSocketTimeoutMillis(timeout);
}
void suspendSessionOutput() {
@@ -564,21 +564,21 @@ abstract class AbstractHttp1StreamDuplexer<IncomingMessage extends HttpMessage,
@Override
public void setSocketTimeoutMillis(final int timeout) {
- ioSession.setSocketTimeout(timeout);
+ ioSession.setSocketTimeoutMillis(timeout);
}
@Override
public EndpointDetails getEndpointDetails() {
if (endpointDetails == null) {
endpointDetails = new BasicEndpointDetails(ioSession.getRemoteAddress(),
- ioSession.getLocalAddress(), connMetrics, ioSession.getSocketTimeout());
+ ioSession.getLocalAddress(), connMetrics, ioSession.getSocketTimeoutMillis());
}
return endpointDetails;
}
@Override
public int getSocketTimeoutMillis() {
- return ioSession.getSocketTimeout();
+ return ioSession.getSocketTimeoutMillis();
}
@Override
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamDuplexer.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamDuplexer.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamDuplexer.java
index 186f8b4..1762a57 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamDuplexer.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamDuplexer.java
@@ -125,12 +125,12 @@ public class ClientHttp1StreamDuplexer extends AbstractHttp1StreamDuplexer<HttpR
@Override
public int getSocketTimeoutMillis() {
- return getSessionTimeout();
+ return getSessionTimeoutMillis();
}
@Override
public void setSocketTimeoutMillis(final int timeout) {
- setSessionTimeout(timeout);
+ setSessionTimeoutMillis(timeout);
}
@Override
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamHandler.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamHandler.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamHandler.java
index 41562d5..b0485a4 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamHandler.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamHandler.java
@@ -163,7 +163,7 @@ class ClientHttp1StreamHandler implements ResourceHolder {
if (expectContinue) {
requestState = MessageState.ACK;
timeout = outputChannel.getSocketTimeoutMillis();
- outputChannel.setSocketTimeoutMillis(h1Config.getWaitForContinueTimeout());
+ outputChannel.setSocketTimeoutMillis(h1Config.getWaitForContinueTimeoutMillis());
} else {
requestState = MessageState.BODY;
exchangeHandler.produce(internalDataChannel);
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamDuplexer.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamDuplexer.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamDuplexer.java
index 1491da1..edfca1e 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamDuplexer.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamDuplexer.java
@@ -130,12 +130,12 @@ public class ServerHttp1StreamDuplexer extends AbstractHttp1StreamDuplexer<HttpR
@Override
public int getSocketTimeoutMillis() {
- return getSessionTimeout();
+ return getSessionTimeoutMillis();
}
@Override
public void setSocketTimeoutMillis(final int timeout) {
- setSessionTimeout(timeout);
+ setSessionTimeoutMillis(timeout);
}
@Override
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSession.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSession.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSession.java
index 144824f..01ce0ac 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSession.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSession.java
@@ -172,7 +172,7 @@ public interface IOSession extends ModalCloseable, Identifiable {
*
* @return socket timeout.
*/
- int getSocketTimeout();
+ int getSocketTimeoutMillis();
/**
* Sets value of the socket timeout in milliseconds. The value of
@@ -180,7 +180,7 @@ public interface IOSession extends ModalCloseable, Identifiable {
*
* @param timeout socket timeout.
*/
- void setSocketTimeout(int timeout);
+ void setSocketTimeoutMillis(int timeout);
/**
* Returns timestamp of the last read event.
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
index 3db047a..c5aff5e 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
@@ -165,12 +165,12 @@ class IOSessionImpl implements IOSession {
}
@Override
- public int getSocketTimeout() {
+ public int getSocketTimeoutMillis() {
return this.socketTimeout;
}
@Override
- public void setSocketTimeout(final int timeout) {
+ public void setSocketTimeoutMillis(final int timeout) {
this.socketTimeout = timeout;
}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5/src/main/java/org/apache/hc/core5/reactor/InternalDataChannel.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/InternalDataChannel.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/InternalDataChannel.java
index 3f4878e..2b0cc00 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/InternalDataChannel.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/InternalDataChannel.java
@@ -173,7 +173,7 @@ final class InternalDataChannel extends InternalChannel implements ProtocolIOSes
@Override
int getTimeoutMillis() {
- return ioSession.getSocketTimeout();
+ return ioSession.getSocketTimeoutMillis();
}
@Override
@@ -349,13 +349,13 @@ final class InternalDataChannel extends InternalChannel implements ProtocolIOSes
}
@Override
- public int getSocketTimeout() {
- return ioSession.getSocketTimeout();
+ public int getSocketTimeoutMillis() {
+ return ioSession.getSocketTimeoutMillis();
}
@Override
- public void setSocketTimeout(final int timeout) {
- ioSession.setSocketTimeout(timeout);
+ public void setSocketTimeoutMillis(final int timeout) {
+ ioSession.setSocketTimeoutMillis(timeout);
}
@Override
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5/src/main/java/org/apache/hc/core5/reactor/SingleCoreIOReactor.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/SingleCoreIOReactor.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/SingleCoreIOReactor.java
index edc5c8b..9761ba1 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/SingleCoreIOReactor.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/SingleCoreIOReactor.java
@@ -205,7 +205,7 @@ class SingleCoreIOReactor extends AbstractSingleCoreIOReactor implements Connect
}
final InternalDataChannel dataChannel = new InternalDataChannel(ioSession, null, sessionListener, closedSessions);
dataChannel.upgrade(this.eventHandlerFactory.createHandler(dataChannel, null));
- dataChannel.setSocketTimeout(this.reactorConfig.getSoTimeout().toMillisIntBound());
+ dataChannel.setSocketTimeoutMillis(this.reactorConfig.getSoTimeout().toMillisIntBound());
key.attach(dataChannel);
dataChannel.handleIOEvent(SelectionKey.OP_CONNECT);
}
@@ -332,7 +332,7 @@ class SingleCoreIOReactor extends AbstractSingleCoreIOReactor implements Connect
}
final InternalDataChannel dataChannel = new InternalDataChannel(ioSession, namedEndpoint, sessionListener, closedSessions);
dataChannel.upgrade(eventHandlerFactory.createHandler(dataChannel, attachment));
- dataChannel.setSocketTimeout(reactorConfig.getSoTimeout().toMillisIntBound());
+ dataChannel.setSocketTimeoutMillis(reactorConfig.getSoTimeout().toMillisIntBound());
return dataChannel;
}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3af89cc7/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
index 0f1aa70..7bb0f66 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
@@ -658,8 +658,8 @@ public class SSLIOSession implements IOSession {
return;
}
this.status = CLOSING;
- if (this.session.getSocketTimeout() == 0) {
- this.session.setSocketTimeout(1000);
+ if (this.session.getSocketTimeoutMillis() == 0) {
+ this.session.setSocketTimeoutMillis(1000);
}
try {
updateEventMask();
@@ -779,13 +779,13 @@ public class SSLIOSession implements IOSession {
}
@Override
- public int getSocketTimeout() {
- return this.session.getSocketTimeout();
+ public int getSocketTimeoutMillis() {
+ return this.session.getSocketTimeoutMillis();
}
@Override
- public void setSocketTimeout(final int timeout) {
- this.session.setSocketTimeout(timeout);
+ public void setSocketTimeoutMillis(final int timeout) {
+ this.session.setSocketTimeoutMillis(timeout);
}
@Override