Reputation: 41
I need to enable keep alive in gsoap.
I tried it by setting soap.keep_alive = 1
and setting the keep alive flag for input/output modes.
But still I am not observing keep alive messages in wireshark.
How to enable keep alive in gsoap and what are the necessary parameters to set ?
Upvotes: 3
Views: 2531
Reputation: 3998
To enable keep-alive support, you need to set the flag SOAP_IO_KEEPALIVE
when you initialize runtime with soap_init2()
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).
Upvotes: 2