Re: Firing Events from Modile containing a Threads code

From: Chris Tacke, eMVP (ctacke_at_spamfree-opennetcf.org)
Date: 05/24/04


Date: Mon, 24 May 2004 10:00:10 -0400

Take a look at this:

http://www.codeproject.com/vb/net/StepByStepEventsInVBNET.asp

-- 
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com
"James Anderson" <anonymous@discussions.microsoft.com> wrote in message
news:AE05DCEF-29FE-4B41-90A1-CFDD2722096B@microsoft.com...
> Hi,
>
> Ive been advised to use events in my app.  I have a worker thread that
listens for UDP packets.  It converts the incoming UDP Byte array into a
Packet object.  This then gets placed onto a ReceivedPackets Queue.  Im not
too familiar with Events but need to know how to get my thread to fire the
event and my form, could 1 of 9 forms, to detect that event has been fired
and handle it.
>
> I know that I should use "RaiseEvent" in the Thread. The thread has been
declared in a Module.  How do I put it all together?  I guess the forms need
something like "AddHandler EventName, New EventHandler Addressof
procedureToRun" but donr know how to put it all together.  I tried but the
Thread was complaining of an "End of statement expected" compilor error.
>
> Also, If Ive received 2 packets with a 200ms interval between them and
hence the event gets fired twice, what happens? does the app wait for the
first procedure to finish executing and then call the method again in
response to the second event firing? Can this cause potential delay/problems
in my app?
>
> Im using VB.NET but C# will suffice.
>
> Thanks.


Relevant Pages

  • Re: ActiveX.exe more problems
    ... it's not a Streaming device. ... Jungo assumes this too ... App doesn't see an Abort or Stop flag it starts interrogating the USB device ... Packets are received ...
    (microsoft.public.vb.general.discussion)
  • Re: Weird (unsecure?) behaviour when trying IP forwarding.
    ... MAC address set to my PDAs mac, but the destination IP address is not ... one of the PDA. ... somehow the packets are always accepted, but then why is this and what ... Don't laugh with the last thing, at one moment we had an app running on ...
    (microsoft.public.pocketpc.developer.networking)
  • Re: IOCP critical sections and mutexes
    ... just deleted object. ... My packets never go over 2k in size. ... then pushes it in a queue that will be later processed by my main app ... If I use a mutex instead it works fine. ...
    (microsoft.public.win32.programmer.kernel)
  • Weird (unsecure?) behaviour when trying IP forwarding.
    ... MAC address set to my PDAs mac, but the destination IP address is not ... one of the PDA. ... somehow the packets are always accepted, but then why is this and what ... Don't laugh with the last thing, at one moment we had an app running on ...
    (microsoft.public.pocketpc.developer.networking)