473,587 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multithreaded events in dll to prevent blocking

Opa

I have a synchronous socket dll which fires several events to a winforms
client.
The winform calls methods on the dll and the dll fires an event back on the
same thread. I want the dll to fire events back on a different thread, but
am not sure how to go about this.

The dll has many events,, each event has different event arguments, so must
I create a thread for each event?

Without these threads, my winform app sometimes seems to "miss" the events
fired from the dll.

Can anyone guide me with some sample code? Perhaps a url demonstrating this?

Thanks

Nov 22 '05 #1
1 1209
"Opa" <Op*@discussion s.microsoft.com > wrote in message
news:53******** *************** ***********@mic rosoft.com...

I have a synchronous socket dll which fires several events to a winforms
client.
The winform calls methods on the dll and the dll fires an event back on
the
same thread. I want the dll to fire events back on a different thread,
but
am not sure how to go about this.


Events are always fired on the same thread as the code raising the event. If
this might be a different thread from the one containing the message loop,
then the event handler must use Form.Invoke. Otherwise, you'll see the kind
of problem you've seen.

John Saunders
Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2780
by: Dan Kelley | last post by:
We have a multithreaded app that responds to events, and writes these events to a text file. This text file is used by an external system for further processing. We want to be able to write multiple entries to the file, and then rename it and copy it to a new location when the file reaches a certian size, or a certain time span elapses...
1
270
by: Opa | last post by:
I have a synchronous socket dll which fires several events to a winforms client. The winform calls methods on the dll and the dll fires an event back on the same thread. I want the dll to fire events back on a different thread, but am not sure how to go about this. The dll has many events,, each event has different event arguments, so...
1
4693
by: edgar Okioga | last post by:
Hi, Please answere me on my email :) I have a socket server that monitors a linux directory for file changes. These steps take place : 1) Once a new file is added to the directory, the application reads the contents of the file which are name of a client computer and some data. 2) Using the client computer name, the server then sends
6
302
by: Dan Kelley | last post by:
We have a multithreaded app that responds to events, and writes these events to a text file. This text file is used by an external system for further processing. We want to be able to write multiple entries to the file, and then rename it and copy it to a new location when the file reaches a certian size, or a certain time span elapses...
0
7918
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
6621
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5713
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.