套接字Backlog行为 [英] Socket Backlog behaviour

查看:233
本文介绍了套接字Backlog行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果Serversocket在其待办事项中有充满请求并且执行长时间运行的作业,则套接字行为将是什么。
当我尝试这个时,从windows telnet可以,它连接。但是从unix中得到连接拒绝
我的应用程序是用 java 编写的,并在 IBM jvm 上运行。
顺便提一下,我的应用程序没有从unix响应telnet。
不支持意味着它正在写tyring ......并挂起,而不是拒绝或连接。任何人都可以证明这种行为吗?
谢谢。

In case of a Serversocket have full of request in its backlog and doing a long running job what will be the socket behaviour. When I try this, from windows telnet is ok, it connects. But from unix it gets "connection refused". My application is written in java and running on IBM jvm. By the way I came to that point where our application was not responding telnet from unix. Not respoing means it was writing "tyring..." and hangs, not refusing or connecting. Can anybody justify this behavior? Thank you.

推荐答案

如果套接字处于LISTEN状态,则不应该拒绝连接。在您耗尽积压设置提供的插槽之前,应该确认您的连接请求(但不会发生任何其他情况)。当您达到 listen 系统调用设置的积压限制时,正在尝试...是正常行为(服务器正在丢弃数据包,直到可以使用侦听积压插槽,客户端正在重新传输SYN数据包,直到发生连接超时或服务器确认连接请求为止。

You should not get "Connection refused", if the socket is in LISTEN state. Until you exhaust the slots provided by the backlog setting, your connect requests should be acknowledged (but nothing more happens). When you reach the backlog limit set by the listen system call, "Trying..." is the normal behaviour (the server is dropping packets until a listening backlog slot is available, the client is retransmitting SYN packets until the connect timeout happens or the server acknowledges the connect request).

这篇关于套接字Backlog行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆