5

I'm using gsoap 2.8 in order to connect to a WCF service (My application is the client).

Is it threadsafe? Should I define some precompiled definition?

Thanks,

Mattan

Mattan
  • 289
  • 1
  • 4
  • 14

1 Answers1

3

Although I've only used gsoap in a single thread I found this in the documentation for 2.8.1

From the gSoap documentation found here

A runtime context can be reused as many times as necessary for client-side remote calls and does not need to be reinitialized in doing so. A new context is required for each new thread to guarantee exclusive access to runtime context by threads. Also the use of any client calls within an active service method requires a new context.

nathan
  • 5,513
  • 4
  • 35
  • 47
  • I think it has a problem: There is a static variable called tcp_done, being used in tcp_init and soap_cleanup. Concurrent calls to these functions can result in performing the "singleton" phrase few times. What do you think? – Mattan Feb 28 '11 at 16:31
  • I never had the need to investigate using it multi-threaded, but if you're seeing static singleton's then yeah, I agree, probably not thread safe. – nathan Feb 28 '11 at 16:38
  • 1
    That is incorrect. There is no `tcp_done` in the code. The gSOAP client and services are MT-safe when you provide a `soap` context to each thread. This is by design. – Dr. Alex RE Jul 06 '17 at 01:28