我在CentOS中使用Jetty构建了Restesy服务,对于Window Phone或IOS客户端没有问题,但对于Android客户端,超时会发生超时。
我通过tcpdump跟踪连接,并看到超时发生时的数据包是否类似,例如:
TIMEOUT
10:24:38.359095 IP 116.101.38.222.47360 > 123.30.210.5.8890: Flags [S], seq 888244766, win 14600, options [mss 1452,sackOK,TS val 4903276 ecr 0,nop,wscale 7], length 0
10:24:38.359138 IP 123.30.210.5.8890 > 116.101.38.222.47360: Flags [S.], seq 2238335766, ack 888244767, win 14480, options [mss 1460,sackOK,TS val 2336383696 ecr 4903276,nop,wscale 9], length 0
10:24:38.362449 IP 116.101.38.222.47360 > 123.30.210.5.8890: Flags [.], ack 1, win 115, options [nop,nop,TS val 4903278 ecr 2336383696], length 0
10:24:38.392668 IP 116.101.38.222.47360 > 123.30.210.5.8890: Flags [P.], seq 1:837, ack 1, win 115, options [nop,nop,TS val 4903280 ecr 2336383696], length 836
10:24:38.392697 IP 123.30.210.5.8890 > 116.101.38.222.47360: Flags [.], ack 837, win 32, options [nop,nop,TS val 2336383729 ecr 4903280], length 0
10:24:38.617932 IP 123.30.210.5.8890 > 116.101.38.222.47360: Flags [P.], seq 1:365, ack 837, win 32, options [nop,nop,TS val 2336383955 ecr 4903280], length 364
10:24:38.618078 IP 123.30.210.5.8890 > 116.101.38.222.47360: Flags [P.], seq 365:372, ack 837, win 32, options [nop,nop,TS val 2336383955 ecr 4903280], length 7
10:24:38.621261 IP 116.101.38.222.47360 > 123.30.210.5.8890: Flags [.], ack 365, win 123, options [nop,nop,TS val 4903303 ecr 2336383955], length 0
10:24:38.621894 IP 116.101.38.222.47360 > 123.30.210.5.8890: Flags [.], ack 372, win 123, options [nop,nop,TS val 4903303 ecr 2336383955], length 0
10:25:08.619071 IP 123.30.210.5.8890 > 116.101.38.222.47360: Flags [F.], seq 372, ack 837, win 32, options [nop,nop,TS val 2336413956 ecr 4903303], length 0
10:25:08.692600 IP 116.101.38.222.47360 > 123.30.210.5.8890: Flags [.], ack 373, win 123, options [nop,nop,TS val 4906311 ecr 2336413956], length 0
正常
10:27:36.913571 IP 116.101.38.222.47371 > 123.30.210.5.8890: Flags [S], seq 2720593029, win 14600, options [mss 1452,sackOK,TS val 4910920 ecr 0,nop,wscale 7], length 0
10:27:36.913599 IP 123.30.210.5.8890 > 116.101.38.222.47371: Flags [S.], seq 4293963922, ack 2720593030, win 14480, options [mss 1460,sackOK,TS val 2336562250 ecr 4910920,nop,wscale 9], length 0
10:27:36.916232 IP 116.101.38.222.47371 > 123.30.210.5.8890: Flags [.], ack 1, win 115, options [nop,nop,TS val 4910920 ecr 2336562250], length 0
10:27:36.929731 IP 116.101.38.222.47371 > 123.30.210.5.8890: Flags [P.], seq 1:837, ack 1, win 115, options [nop,nop,TS val 4910922 ecr 2336562250], length 836
10:27:36.929750 IP 123.30.210.5.8890 > 116.101.38.222.47371: Flags [.], ack 837, win 32, options [nop,nop,TS val 2336562266 ecr 4910922], length 0
10:27:36.933454 IP 123.30.210.5.8890 > 116.101.38.222.47371: Flags [P.], seq 1:365, ack 837, win 32, options [nop,nop,TS val 2336562270 ecr 4910922], length 364
10:27:36.933532 IP 123.30.210.5.8890 > 116.101.38.222.47371: Flags [P.], seq 365:372, ack 837, win 32, options [nop,nop,TS val 2336562270 ecr 4910922], length 7
10:27:36.936567 IP 116.101.38.222.47371 > 123.30.210.5.8890: Flags [.], ack 365, win 123, options [nop,nop,TS val 4910922 ecr 2336562270], length 0
10:27:36.936963 IP 116.101.38.222.47371 > 123.30.210.5.8890: Flags [.], ack 372, win 123, options [nop,nop,TS val 4910922 ecr 2336562270], length 0
10:28:06.933824 IP 123.30.210.5.8890 > 116.101.38.222.47371: Flags [F.], seq 372, ack 837, win 32, options [nop,nop,TS val 2336592270 ecr 4910922], length 0
10:28:07.029333 IP 116.101.38.222.47371 > 123.30.210.5.8890: Flags [.], ack 373, win 123, options [nop,nop,TS val 4913932 ecr 2336592270], length 0
我无法理解我的问题,但我看到,服务器在最后一个ACk数据包30s之后发送FIN数据包,所以我想把这个时间增加到60s或更多。如果您知道如何增加这段时间,或者您知道我的问题,请帮帮我
非常感谢,
丛