0

Nowdays there is the server (gsoap) written by c++. I have c# application (c# 4.0, winforms). I generate wsdl from this service. So I can call some functions in my app.

But the duration of this functions is more than hour. I think, that the best way is:

1) I call this function in thread in my application.

2) Another person call this function in separate thread in their application.

But this person tell me that it is impossible. She says, that "in gsoap there is no such functionality as thread"

Is it true? I do not understand why it is impossible..

crthompson
  • 15,653
  • 6
  • 58
  • 80
novicegis
  • 519
  • 3
  • 5
  • 13

2 Answers2

1

1) I call this function in thread in my application.

2) Another person call this function in separate thread in their application.

If by application you mean the webservice client application the short answer is no that in itself won't cause gsoap to handle requests on multiple threads. gsoap doesn't provide any multithreading functionality out of the box. Launching a separate thread in the client application doesn't launch a corresponding thread on the (gsoap) server.

Your hunch though that multiple threads could be used to handle requests from multiple clients is right. However you'll need to create and manage those threads yourself in the gsoap application. You may find the this discussion helpful - gSOAP Multithreading

Community
  • 1
  • 1
hawk
  • 1,827
  • 2
  • 14
  • 28
  • Is it very difficult for another person to create thread for one function only? (It means that this function always will be in separate tread in gsoap. Can I call another function(fast) and this function will be complete?) – novicegis Oct 22 '13 at 08:42
  • 1
    In this case one dedicated thread for one function is trickier than having a new thread per call to that function. Though all that depends on your experience with pthreads library. – hawk Oct 22 '13 at 08:55
1

When you have a service-call that is running for an hour or more...wouldn't it be better to modify your service-interface? You could return an "id" of some sort (integer, or maybe a GUID). And have a call IsFinished(id), which returns the current status. When IsFinished returns true, the User can then retrive the result via a GetResult(id) call.

This is more work on the interface side, but maybe it makes your server easier to maintain. And it is cleaner on the client side.

Henno
  • 397
  • 1
  • 7