473,574 Members | 2,493 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Meesage Queue

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
Jan 18 '06 #1
2 1176
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

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Jan 18 '06 #2
You should consider using the System.Collecti ons.Queue class for this.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Macca" wrote:
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

Jan 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2486
by: Brian Henry | last post by:
If i inherite a queue class into my class, and do an override of the enqueue member, how would i then go about actually doing an enqueue of an item? I am a little confused on this one... does over ride just add aditional code ontop of the current class or completely over ride it in vb? I am use to C++ this is the first inherited thing I've...
3
5141
by: Kceiw | last post by:
Dear all, When I use #include "queue.h", I can't link it. The error message follows: Linking... G:\Projects\Datastructure\Queue\Debug\main.o(.text+0x136): In function `main': G:\Projects\Datastructure\Queue\main.cpp:16: undefined reference to `Queue<char>::Queue()' G:\Projects\Datastructure\Queue\Debug\main.o(.text+0x394): In function...
2
2951
by: lavender | last post by:
When define a maxQueue is 10, means it able to store 10 items in circular queue,but when I key in the 10 items, it show "Queue Full" in items number 10. Where is the wrong in my code? Why it cannot store up to 10 items? Output from my code: Enter you choice: 1 Enter ID document to print : 21 Enter you choice: 1 Enter ID document to...
3
2028
by: jrpfinch | last post by:
I have a script which is based on the following code. Unfortunately, it only works on Python 2.3 and not 2.5 because there is no esema or fsema attribute in the 2.5 Queue. I am hunting through the Queue.py code now to try to figure out how to make it work in 2.5, but as I am a beginner, I am having difficulty and would appreciate your help....
4
4592
by: j_depp_99 | last post by:
Thanks to those guys who helped me out yesterday. I have one more problem; my print function for the queue program doesnt work and goes into an endless loop. Also I am unable to calculate the length of my queue. I started getting compilation errors when I included a length function. <code> template<class ItemType> void...
0
1157
by: javajaunit | last post by:
HI, I have a requirement that to place a message from folder to MQ QUEUE. Messages are stored in a ".dat" file. I am reading this file(it contains xml data) from folder and converting this file into a string and placing into MQ MQ Queue. For normal messages its working fine..but the messages which is having MQMD header and canonical header i...
2
3608
by: jrumanek | last post by:
Hallo, I have problem with function WaveInOpen . This function doesn't return meesage MM_WIM_OPEN? Shall YOU help me pleas? Any suggestions? Thank you!
2
2922
by: ecestd | last post by:
how do you implement a copy constructor for this pointer-based ADT queue #include <cassert // for assert #include <new // for bad_alloc using namespace std; //private:{Queue::Queue(const Queue& Q)}
0
2733
by: ecestd | last post by:
I did implement the copy constructor but still have a problem with it. It is not working. What could be wrong? #include "QueueP.h" #include <cassert // for assert #include <new // for bad_alloc #include <iostream> //typedef std::queue<QueueItemTypeQueue; using namespace std; //private:{Queue::Queue(const Queue& Q)}
0
8079
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7833
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8118
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6481
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5635
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3756
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3770
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1081
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.