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