Re: Architecture advise wanted.
From: William Stacey [MVP] (staceywREMOVE_at_mvps.org)
Date: 08/02/04
- Next message: Nicholas Paldino [.NET/C# MVP]: "Re: fatal error CS0009: Metadata file"
- Previous message: Edward Mostrom: "RE: datatable relations with column expression bug"
- In reply to: Frank Rizzo: "Re: Architecture advise wanted."
- Next in thread: Frank Rizzo: "Re: Architecture advise wanted."
- Reply: Frank Rizzo: "Re: Architecture advise wanted."
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 2 Aug 2004 16:54:52 -0400
Not sure I follow. Why gen an event? Your listener will put the packet
object into the CQueue and Listen again. Your Consumer will wait until the
queue has an object and then go. So you don't need an event unless your
using for some other reason. You can get fancy with no-lock queues and two
lock queues (etc), but in the end I think a one lock blocking queue (not the
Framework queue) is about the best concidering all things and is relatively
easy to verify thread safety'ness and rw memory barrier issues. What is
your arch in more detail? tia
-- William Stacey, MVP "Frank Rizzo" <none@none.com> wrote in message news:#jmZnYMeEHA.3512@TK2MSFTNGP12.phx.gbl... > William Stacey [MVP] wrote: > > >One way. Create a listener thread that listens for udp on port n. It grabs > >packets and verifies them, etc and puts them into a queue (blocking queue, > >etc.) the stack will queue to some extent then just drop anything new (I > >think) once the winsock queue is full. One reason why udp is not gaurenteed > >delivery (tcp on the other hand would resend the packet, etc.) The client > >then needs to restransmit if it does not get a response using your own algo. > >hth > > > > > Thanks. That's what I settled on. The only thing that still bugs is > that I listen for UDP packets on a different thread (because > UdpClient.Receive is blocking), then I generate an event that is > consumed by the calling class. I am just not sure whether this setup is > thread-safe. > > Thanks.
- Next message: Nicholas Paldino [.NET/C# MVP]: "Re: fatal error CS0009: Metadata file"
- Previous message: Edward Mostrom: "RE: datatable relations with column expression bug"
- In reply to: Frank Rizzo: "Re: Architecture advise wanted."
- Next in thread: Frank Rizzo: "Re: Architecture advise wanted."
- Reply: Frank Rizzo: "Re: Architecture advise wanted."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading