Events from Threads

  • Thread starter Thread starter Dirk Reske
  • Start date Start date
D

Dirk Reske

Hey,

I have a Server thats starts a thread for each incoming connection

class Server
{
public Event IncomingMessage;

....//Here a thread is listening for incoming network conenctions
//this thread starts a ServerThread for each connection
}

class ServerThread
{

...//Here we "speak" with the client
}

my question is: how can I call the IncomingMessage event from one of the
ServerThreads?
 
If the recipient of the event is going to be in the user-interface thread,
you should invoke a callback on the object using BeginInvoke. If you do that
on any object that inherits from Control, the invocation will occur on the
user interface thread, via the windows message pump.
 
sorry,

I don't know where I have to invoke...
can you mdify my code, if I send it to you?
 
Sorry I don't really have time to work on other people's code, I barely have
time to work on my own!

Can you clarify your question a little, and provide a clearer example of how
you expect it to work.
 
it works now....thank you!!!


John Wood said:
Sorry I don't really have time to work on other people's code, I barely have
time to work on my own!

Can you clarify your question a little, and provide a clearer example of how
you expect it to work.
 
Back
Top