S
Sacha
hello,
I'm using C# and having a little thread communication problem :
-one thread (and its associated object) receives UDP packets using the
UdpClient class
-another object (say Object2) needs to raise an event from another thread
when a packet is received.
-as Object2 *could* be sitting on the main thread, it cannot be blocked
waiting on the "UdpThread"
-Object2 is not a System.Window.Forms.Control
-I'd rather avoid polling some synchronized variable.
in the good old win32 times, i would have allocated a window handle in
Object2's thread and
used PostMessage from the UdpThread.=> no polling and no locking...
Any advice on what should be done to remain in the .NET spirit while
achieving such goals ?
thanks in advance
Sacha De Vos
I'm using C# and having a little thread communication problem :
-one thread (and its associated object) receives UDP packets using the
UdpClient class
-another object (say Object2) needs to raise an event from another thread
when a packet is received.
-as Object2 *could* be sitting on the main thread, it cannot be blocked
waiting on the "UdpThread"
-Object2 is not a System.Window.Forms.Control
-I'd rather avoid polling some synchronized variable.
in the good old win32 times, i would have allocated a window handle in
Object2's thread and
used PostMessage from the UdpThread.=> no polling and no locking...
Any advice on what should be done to remain in the .NET spirit while
achieving such goals ?
thanks in advance
Sacha De Vos