Java Vert.x 3.7.0 HttpRequest sendForm()/sendBuffer()/sendJson()方法在主机不可用时永远不会返回

Java Vert.x 3.7.0 HttpRequest sendForm()/sendBuffer()/sendJson()方法在主机不可用时永远不会返回,java,httprequest,vert.x,Java,Httprequest,Vert.x,我对Vert.x 3.7.0和3.7.1有一个奇怪的问题:HttpRequestsend方法在请求体中传输数据(sendForm(),sendJson(),sendBuffer()等)-如果主机不可用,则除了send())之外的所有方法都不会返回 如果端口4012上没有服务器,则以下代码永远不会返回: HttpClientOptions选项=新的HttpClientOptions() .setDefaultHost(“本地主机”) .setDefaultPort(4012); Vertx Ver

我对Vert.x 3.7.0和3.7.1有一个奇怪的问题:
HttpRequest
send方法在请求体中传输数据(
sendForm()
sendJson()
sendBuffer()
等)-如果主机不可用,则除了
send()
)之外的所有方法都不会返回

如果端口4012上没有服务器,则以下代码永远不会返回:

HttpClientOptions选项=新的HttpClientOptions()
.setDefaultHost(“本地主机”)
.setDefaultPort(4012);
Vertx Vertx=Vertx.Vertx();
WebClient-WebClient=WebClient.create(vertx,新的WebClientOptions(选项));
HttpRequest request=webClient.request(HttpMethod.POST,“/test”);
info(“将请求作为sendForm()发送”);
request.sendForm(MultiMap.caseInsensitiveMultiMap(),事件->{
if(event.failed()){
logger.error(“Failed!”,event.cause());
}否则{
logger.info(“成功!代码{}{}”,event.result().statusCode(),event.result().statusMessage());
}
vertx.close();
});
如果改用
request.send(event->{…})
,则它会打印(如预期的那样):

3.7.0之前的Vert.x没有问题:我尝试了3.6.3,并且
send()
sendForm()
返回
java.net.ConnectException:连接被拒绝:无进一步信息
。这就是为什么我怀疑这是一个bug(在Vert.x中,或者在底层io.netty中),除非我在代码中使用未定义的行为

这里有来自Vert.x社区的人吗?:)

提前感谢您的帮助


另外,我在Windows 10上,Java使用JVM Amazon Corretto 11.0.3。

我曾经在Windows 10上遇到过这种情况。我禁用了防火墙,并重新启动了Vert.x应用程序,这就产生了神奇的效果。

我已经调试了一段时间,似乎该部分有一个bug:。我建议在GitHub上打开这个问题,除非我遗漏了什么。
27.06.19 16:47:17,352 ERROR - Failed! io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: localhost/127.0.0.1:4012
    at java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:779)
    at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:327)
    at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:632)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.net.ConnectException: Connection refused: no further information
    ... 11 more