user3628417
user3628417

Reputation: 41

GSOAP: enabling keep alive in gsoap

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

Answers (1)

HAL
HAL

Reputation: 3998

To enable keep-alive support, you need to set the flag SOAP_IO_KEEPALIVE when you initialize runtime with soap_init2()

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).

Upvotes: 2

Related Questions