2017-04-02 47 views
1

我有一个服务在启动后将在端口8443上侦听。 我有xinetd配置为在端口8443上建立连接时启动我的服务。如何使xinetd与wait = yes一起工作= yes对于protocol = tcp

所以Xinetd应该启动我的应用程序,然后让我的应用程序处理任何更多的传入连接。

我得到了重复“警告:无法获取客户端地址:传输端点未连接”,然后Xinetd禁用我的服务10秒。

这只发生在我设置wait = yes时。

停止我的应用程序从收听端口8443没有什么区别。

我对xinetd等待标志的理解是否正确,或者我对xinetd配置做错了什么?

我已经看过手册页,wait = yes通常与UDP相关联,但没有内容说明您不能将它用于TCP。

我搜索了SO,我发现的所有东西都有tcp工作,wait = no。

连接到xinetd时出现以下错误。

5786]: warning: can't get client address: Transport endpoint is not connected 
5564]: EXIT: MyApplication status=1 pid=5786 duration=0(sec) 
5564]: START: MyApplication pid=5787 from=<no address> 
5787]: warning: can't get client address: Transport endpoint is not connected 
5564]: EXIT: MyApplication status=1 pid=5787 duration=0(sec) 
5564]: Deactivating service MyApplication due to excessive incoming connections. Restarting in 10 seconds. 
5564]: FAIL: MyApplication connections per second from=<no address> 
5564]: Activating service MyApplication 

我的配置是:

disable = no 
    socket_type = stream 
    protocol  = tcp 
    wait   = yes 
    user   = user 
    server  = /usr/bin/MyApplication 
    port   = 8443 
    type   = UNLISTED 
    flags   = IPv4 

回答

0

从手册页

wait    This attribute determines if the service is single-threaded or multi-threaded and whether or not xinetd accepts the connection or the server program accepts the 
        connection. If its value is yes, the service is single-threaded; this means that xinetd will start the server and then it will stop handling requests for the 
        service until the server dies and that the server software will accept the connection. If the attribute value is no, the service is multi-threaded and xinetd 
        will keep handling new service requests and xinetd will accept the connection. It should be noted that udp/dgram services normally expect the value to be yes 
        since udp is not connection oriented, while tcp/stream servers normally expect the value to be no. 

所以,如果你有等待= YES,你是单线程的。一旦有连接,就无法连接,直到当前会话断开连接或脚本结束。

相关问题