Winsock DataArrival
Winsock DataArrival
Winsock DataArrival
Winsock DataArrival
Winsock DataArrival
Winsock DataArrival Winsock DataArrival Winsock DataArrival Winsock DataArrival Winsock DataArrival Winsock DataArrival Winsock DataArrival Winsock DataArrival
Winsock DataArrival Winsock DataArrival
Winsock DataArrival
Go Back  Xtreme Visual Basic Talk > > > Winsock DataArrival


Reply
 
Thread Tools Display Modes
  #1  
Old 09-03-2010, 02:25 PM
ZaCkOX's Avatar
ZaCkOX ZaCkOX is offline
Contributor
 
Join Date: May 2006
Location: CA
Posts: 645
Default Winsock DataArrival


Just a few questions, making sure I have things right...

The data being sent is string, data is recieved like this: (just an example)

Data sent = "000103|"
Data sent (soon after) = "0200|"

Data Received = "000103|0200|"

So I have a string that contains the data, and a delimiter "|" to search for. I will use Instr() to see if a delimiter exists, and if so remove out the necessary string and have more code executed by select case.

I'm not good on words, but is this the so-called buffer process? And do I not know something important that I should? I'm only sending data type string at this point.
__________________
ZaCkO ... Who is your attitude?
Reply With Quote
  #2  
Old 09-04-2010, 04:19 AM
DougT's Avatar
DougT DougT is offline
Ultimate Antique

Administrator
* Expert *
 
Join Date: Sep 2005
Location: Maldon,Essex, UK
Posts: 3,939
Default

What I normally do is to Buffer the data until I know there's at least 1 delimiter present in the Buffer. Then process the record, then go back and see if there's another delimiter there, if there is, then process it and look again. If not, then, if all the data has been processed, flush the buffer, otherwise, move the remaining partial record to the front of the buffer and wait for the next delimiter.

eg

Data received is added into Buffer
Start Loop:
Is there a delimiter in the Buffer?
Yes: Process the data and remove it from the buffer
Loop until the buffer is empty or there's data but no delimiter in the buffer
__________________
semel insanivimus omnes
S Data in context = Information, S Information in context = Knowledge, S Knowledge in context = Experience
S Experience in context = Wisdom= Data
Reply With Quote
  #3  
Old 09-04-2010, 02:38 PM
ZaCkOX's Avatar
ZaCkOX ZaCkOX is offline
Contributor
 
Join Date: May 2006
Location: CA
Posts: 645
Default Yea thanks

Thanks, yea I have the same process, just making sure I didn't miss anything.

Those big words "like buffer" make me a little confused. I'm happy to see I am in the right direction. Thanks again!
__________________
ZaCkO ... Who is your attitude?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Winsock DataArrival
Winsock DataArrival
Winsock DataArrival Winsock DataArrival
Winsock DataArrival
Winsock DataArrival
Winsock DataArrival Winsock DataArrival Winsock DataArrival Winsock DataArrival Winsock DataArrival Winsock DataArrival Winsock DataArrival
Winsock DataArrival
Winsock DataArrival
 
Winsock DataArrival
Winsock DataArrival
 
-->