473,320 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to handle multiple-message-in-same data-buffer (asyncprogramming)

Hello,

I have written a sample async code (using callback/async).
I am now seeing a situation where-in if two messages are received at
the same-time, both of them show-up in the data-buffer.

Given that i am new to this, can you point to resources or suggest
ways to handle this scenario? (the program runs indefinitely, handling
messages as they come in).

Here is the statement that stores the incoming bytes into a string:

myCompleteMessage = String.Concat(myCompleteMessage,
Encoding.ASCII.GetString(m_DataBuffer, 0, bytesRead));

Note that m_DataBuffer is a byte-array //byte[] m_DataBuffer = new
byte[20000];

There is 'content-length' field in the data that i get, but not sure
how to go-about handling both (or multiple) messages.

Thanks for your time.
Regards,
RS
Mar 18 '08 #1
0 1163

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

Similar topics

1
by: Dietrich | last post by:
Hi. I can't reread a file handle after I have copied it on another file handle for output. Here is the code snippet. Please let me know if you need more. Lines 26 & 27 are my attempts to get...
7
by: Tony Johansson | last post by:
Hello!! Assume I have a handle body pattern with classes called Handle and Body. In the Body class I store one int value for example 7 or some other integer value. In the Handle class I have...
3
by: Fei Yuan | last post by:
Starting an external process needs to pass it a ProcessStartInfo() object. ProcessStartInfo has a property "UseShellExecute" that can open/print a file. However, I'm having a hard time getting the...
3
by: Coder | last post by:
hi, there is still no answer, i wonder if there is a way to handle the multiple key-press event on a C# windows form, like "Ctrl+Enter"
1
by: Sephi berry via .NET 247 | last post by:
Hi I'm having this problem of accessing the handle of a window. I retrive it by: Dim procs As Process() = Process.GetProcessesByName("ArcScene") dim intHWND1 IntPtr = procs(0).Handle and get a...
2
by: areef.islam | last post by:
Hi, I am kinda new to javascript and I am having this problem with selecting multiple options from a select tag. Hope someone can help me out here. here is my code...
5
by: RichG | last post by:
I'm looking for a way to bring an open form to the top. I know that is I open a form directly with form1.show() and then later, while the form is open I do another form1.show(), that I will get...
6
by: sergey | last post by:
I'm new to C++ and I need to create DB connection pool. Here is the class that I have: class uudb { public: uudb(); ~uudb();
2
by: Jonathan Boivin | last post by:
Hi people, Let me introduce to how I get this error. I have a form which load all my bills representation depending upon filters which each bill is a usercontrol of my own having some...
0
by: Gabriel Genellina | last post by:
En Fri, 09 May 2008 07:58:33 -0300, Banibrata Dutta <banibrata.dutta@gmail.comescribió: They can coexist peacefully. The last one you install will be the default version to handle .py files...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.