From: Anders Eriksson on
Hello,

I have a class in which I use System.Threading.Timer. The callback function
should send a message using TCPClient. Since the Callback function is in an
another thread this doesn't work!

How do I Invoke a function in the class thread from the callback function?

The Class is not a Form class!

// Anders
--
English is not my first language
so any error, insults or strangeness
has happend during the translation.
Please correct my English so that I
may become better at it!

From: Peter Duniho on
Anders Eriksson wrote:
> Hello,
>
> I have a class in which I use System.Threading.Timer. The callback
> function should send a message using TCPClient. Since the Callback
> function is in an another thread this doesn't work!

You need to be more specific. Neither TcpClient nor Socket have the
kind of thread affinity that System.Windows.Forms.Control has which
would require invoking a method on a specific thread.

What "doesn't work" about using TcpClient in the callback for the Timer?

Pete