3

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 ?

mpromonet
  • 11,326
  • 43
  • 62
  • 91

1 Answers1

2

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

HAL
  • 3,888
  • 3
  • 19
  • 28