0

Initially, I have problem with the option keep-alive enabled (it blocks the next clients calls. Only the first call that receives an answer).

And now, I need to implement some asynchronous web services using gSoap.

So am I obliged to enable keep-alive in order to implement asynchronous web services?

Thank you a lot!

Farah
  • 2,469
  • 5
  • 31
  • 52

2 Answers2

0

To give some background, establishing a TCP connection has a significant setup overhead. The purpose of keep-alive is to reduce latency by allowing this overhead to be avoided on subsequent connections by reusing the already opened TCP connection instead of constructing a new connection completely from scratch.

You can get the functionality of a web service without using keep alive (after all, keep alive was introduced in HTTP/1.1, and HTTP/1.0 has worked for a long time without keep alive). However, you will definitely experience worse performance than if you properly support keep alive. It should also be noted that, when it comes to establishing connections on mobile, tearing down previous connections and creating new connections completely from scratch rather than keeping a connection open and reusing it may also have implications for the battery. In particular, closing and opening a connection may cause the radio to go to sleep and then wake up again, and the radio usually spends more power when it transitions from sleep to wake than in the steady state.

Michael Aaron Safyan
  • 93,612
  • 16
  • 138
  • 200
0

Your service should be multithreaded to support multiple clients, here gsoap documentation explains it http://www.cs.fsu.edu/~engelen/soapdoc2.html#tth_sEc19.11

Asna
  • 108
  • 8