服务器在建立后立即通过FIN,ACK和RST关闭TCP连接

时间:2013-08-09 08:30:19

标签: java macos tomcat tcp

在Mac OS X 10.8计算机上,我有一台Tomcat 7.0.40服务器和一台客户端,都在本地运行。通过3次握手建立TCP连接,然后立即从服务器获得FIN,ACK和RST。客户端收到“服务器端文件”或“连接重置”。

TCP序列:

客户端SYN
服务器SYN,ACK
客户端确认

服务器[TCP窗口更新] ACK
服务器FIN,ACK
客户ACK 服务器[TCP Dup ACK] ACK
客户GET / myurl / ...
服务器RST

详细
- 客户端和服务器都在本地运行
- 第一个GET请求失败。以下请求成功 - 没有防火墙 - maxfiles已经增加了,徒劳无功

是什么导致服务器关闭套接字?欣赏提示和想法。

编辑:Tomcat的日志具有以下堆栈跟踪:

    FINE: Error parsing HTTP request header
    java.net.SocketException: Invalid argument
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:150)
    at java.net.SocketInputStream.read(SocketInputStream.java:121)
    at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:516)
    at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:501)
    at org.apache.coyote.http11.InternalInputBuffer.parseRequestLine(InternalInputBuffer.java:98)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:928)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)

    Aug 14, 2013 5:15:17 PM org.apache.coyote.http11.AbstractHttp11Processor process
    FINE: Error parsing HTTP request header
    java.io.EOFException: Unexpected EOF read on the socket
    at org.apache.coyote.http11.Http11Processor.setRequestLineReadTimeout(Http11Processor.java:174)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:926)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)

1 个答案:

答案 0 :(得分:0)

您必须违反配置的访问规则,例如IP地址黑名单,或者发送一些它不理解的内容。