what is the efficient way to call a WS multiple times in gSoap with SSL enabled. I have this code:
SimpleInterfaceHttpPostProxy proxy(SOAP_IO_CHUNK | SOAP_IO_KEEPALIVE | SOAP_C_UTFSTRING | SOAP_C_NILSTRING );
proxy.soap->ssl_flags = SOAP_SSL_NO_AUTHENTICATION;
proxy.soap->connect_timeout = TIMEOUT_CONNECT;
proxy.soap->send_timeout = TIMEOUT_SEND;
proxy.soap->recv_timeout = TIMEOUT_RECV;
proxy.soap->socket_flags = MSG_NOSIGNAL;
e__ResultAndString rsp;
int retCode = proxy.CheckChanges("someurl","/checkpath","serialnumber",&rsp);
proxy.destroy();
Now if i want to call proxy.CheckChanges and reuse SSL session and reuse connection i should probably change it to:
while(true)
{
retCode = proxy.CheckChanges("someurl","/checkpath","serialnumber",&rsp);
proxy.destroy();
}
If i do so, the second call always timeouts! If i don't use proxy.destroy(); it works... But does this generates memory leaks?
I mean there are a lot of examples how to use gSoap all made in main, but none that i could find that would reuse proxy/stub and make multiple calls.
So can someone please for others sake :) for the future explain how to make FAST efficient and without memory leak, calls to WS. Which approach is correct, i would like to reuse tcp connection or atleast reuse SSL session in almost 15sec calls.
Thank you!