gpt4 book ai didi

GSOAP:在 gsoap 中启用 keep alive

转载 作者:行者123 更新时间:2023-12-01 14:04:52 26 4
gpt4 key购买 nike

我需要在 gsoap 中启用 keep alive。

我尝试通过设置 soap.keep_alive = 1 并为输入/输出模式设置保持事件标志。
但我仍然没有观察到 wireshark 中的 keep alive 消息。

如何在gsoap中启用keep alive,需要设置哪些参数?

最佳答案

要启用保持事件支持,您需要在使用 soap_init2() 初始化运行时时设置标志 SOAP_IO_KEEPALIVE

TCP and HTTP Keep-Alive

gSOAP supports keep-alive socket connections. To activate keep-alive support, set the SOAP_IO_KEEPALIVE flag for both input and output modes, see Section 9.12. For example

struct soap soap;
soap_init2(&soap, SOAP_IO_KEEPALIVE, SOAP_IO_KEEPALIVE);

When a client or a service communicates with another client or service that supports keep alive, the attribute soap.keep_alive will be set to 1, otherwise it is reset to 0 (indicating that the other party will close the connection).

关于GSOAP:在 gsoap 中启用 keep alive,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23650603/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com