title: multi-threaded gSOAP services
body: <p>Is there a way for the stub/skeleton compiler to generate threaded services (i.e. by spawning a thread for each request or by thread pooling) or do I have to manually add soap_copy(), pthread_create() ...</p>
  
  <p>I know that -- according to the FAQ and user guide 7.2.4 -- gSOAP is thread safe and does support multi-threaded services. However, using the soapcpp2 -i flag I end up with </p>
  
  <pre><code>int DummyService::run(int port)
  {   
      if (soap_valid_socket(bind(NULL, port, 100)))
      {   
          for (;;)
          {   
              if (!soap_valid_socket(accept()))
                   return this-&gt;error;
              (void)serve();
              soap_destroy(this);
              soap_end(this);
          }
      }
      else
          return this-&gt;error;
  
      return SOAP_OK;
  }
  </code></pre>
  
  <p>Any hint?</p>