Meesage Queue

G

Guest

Hi,

I have a desktop application that i would like to design a message handler
into.

Data comes into the app over ethernet which i obtain through a TCP Server on
my PC. I want to take each packet of data and buffer it in a message queue.
Another thread in my app will take each message off of the queue and send it
to appropriate place for processing.

All of this takes place on the same PC.

Now I thought of using the .NET MessageQueue but from first impressions this
seems overkill and seems to emphasise using queue for inter process comms
between 2 or more PC's.

I want to use a "queue" as a means of buffering data between two thread on
the same app on the same PC.

I'd appreciate any advice on this,

Regards
Macca
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,
Data comes into the app over ethernet which i obtain through a TCP Server
on
my PC. I want to take each packet of data and buffer it in a message
queue.
Another thread in my app will take each message off of the queue and send
it
to appropriate place for processing.

Not clear what you mean here, are you saying that you have two applications,
one that is the receiving end of a tcp connection and then the new one taht
you want to create that "sniff" the packages from the first one and do
something with them?
If this is so I thnk you are out of luck , the framework does not support
this, at least I haven't seen it yet.

If you have one app that listen to the network connection & do the
processing the thing changes, what you could do is have two threads , one
waiting to process the message and the other taking care of the network
receiving, a tipical producer-consumer escenario . take a look at
www.yoda.arachsys.com/csharp I think there is an example there of how to do
it
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Queue throughput. 1
Two worker threads using one queue 3
Message queue and multithreading 5
MSMQ send blocking? 6
Synchronize or invoke? 1
message queue 2
Inter-thread message queue in C# 6
Buffering TCPIP data 8

Top