× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Multi-threading is fun! :-)

I would wait on the background thread, just like you are. However, I
would receive the data and send it to the form thread (main thread) and
allow the main thread to run w/it from there. If the main thread needs
to "submit" another thread it can. Of course remember, the call to the
UI function will be a synchronous call, unless you use BeginInvoke
instead of Invoke. So if what you're doing w/the data takes time you
won't be listening for another dataq entry. Probably not a big deal.

Sending the data to the main thread can be done w/the Invoke method call
in my example, since the function it calls is on the form the function
is a "UI function" and can't be called from another thread, but
InvokeRequired will tell you that. IIRC, .NET 1.1 would allow you to do
the call, but 2.0 will throw an exception.

Build this up in pieces, it's the only way you'll get it working. Start
with the background thread listening for requests, then simply dump that
data into a listbox on the UI. Then once that's solid, you can add in
support for doing something else w/the data. Personally I'd do away
w/the dataq and move to a sockets approach as the client-side code would
be much simpler, but that would come at the expense of some server-side
complexity. Not much mind you, but sockets are harder than QSNDDTAQ. :-)

-Walden


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.