2017-04-02 20 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,你是單線程的。一旦有連接,就無法連接,直到當前會話斷開連接或腳本結束。

相關問題