Re: Multithreaded consumer
For the normal function, you use m_WS. For the thread, you create a new webservice. Are you missing some initializing functions?
Check if that line even succeeds (creating the service in the thread), maybe that line is failing.
Re: Multithreaded consumer
Quote:
Originally Posted by Tischnoetentoet
For the normal function, you use m_WS. For the thread, you create a new webservice. Are you missing some initializing functions?
Check if that line even succeeds (creating the service in the thread), maybe that line is failing.
Nothing missing and after the new, there is definitely an object. Also tried using the member but no difference. It really does seem to be the fact that it's on a different thread; almost as if the proxy (or debugger???) is only allowing it to run on the GUI thread, for whatever reason...??? :(
Re: Multithreaded consumer
I think I see what's wrong. The thread goes out of scope, so it is closed.
Maybe I am thinking wrong, but try making the thread object a class object instead of a function object.
Re: Multithreaded consumer
Quote:
Originally Posted by Tischnoetentoet
I think I see what's wrong. The thread goes out of scope, so it is closed.
Maybe I am thinking wrong, but try making the thread object a class object instead of a function object.
Tried that: no difference.... keep the ideas rolling!
Cheers,
T
Re: Multithreaded consumer
But the thread just quits?
Re: Multithreaded consumer
Yup - there's a bit of a debugger hang where nothing seems to happen for a while, then the thread's gone & I see a "The thread 0xnnnn has exited with code 0 (0x0)." in the output window (I know it's the same thread because I've put a "thread 0xnnnn starting" message at the top of the thread proc).
Re: Multithreaded consumer
Just for your information: you can give threads ID's so you can recognize them :)
You stepped through the thread code using F10 (Step)? Which line in the ThreadProc makes the thread close?
Re: Multithreaded consumer
What attribute of Thread is that??? I know you can give them names, didn't realise you could assign an ID too.
Anyhow, stepping over or into any WebMethod on my WebService blows the thread. So in the code above, the first line in the try block in the ThreadProc method:
Code:
NetQCws.DynamicHostInfo[] infos = svc.GetDynamicHostInfo();
Cheers,
T
Re: Multithreaded consumer
And if you don't call the first function (outside the thread), does it still quit?
And about the thread ID, I was talking about the name property :S, my fault!