Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Winsock packetsize problems

Posted on 2001-06-12
7
Medium Priority
?
635 Views
Last Modified: 2013-11-13
Morning all.

   I've stumbled across a HUGE problem with my application.

I'm using winsock to send and recieve (works 100% fine).

When i RECEIVE some XML data, it arrives in 2 packets, becuase the XML DATA is too big for one packet!! I read some previous posts, etc, and found that packet size is around 8192 or something.


PROBLEM
^^^^^^
How do i make it so that strData == winsock.getdata from BOTH packets?! Also, my data can also get VERY LONG! so i can't hardcode the actual number of packets being received.

the main thing i cannot understand is how it KNOWS when a group of packets are part of a broken up string of data... ?

eg..
Private Sub Winsock_DataArrival(ByVal bytesTotal As Long)
    Dim strIncomingText As String
   
'   The incoming data is to data from ALL THE PACKETS..
    Winsock.GetData strIncomingText
End Sub

??

This is so confussing.

Please help :(

-PK-
0
Comment
Question by:pure032398
7 Comments
 
LVL 3

Expert Comment

by:wpsjr1
ID: 6184307
You *can* increase the buffer size... But the correct answer here is "you don't".   Instead you need to append the packets together and parse on some character or characters.  Possibly some XML tag or even vbCrLf.  

Good Luck

Paul
0
 
LVL 1

Author Comment

by:pure032398
ID: 6184484
--> append the packets together ???
--> parse on some characters ???


i sorta understand what u mean .. but examples???

-PK-
0
 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 800 total points
ID: 6184845
const vbtmpdata as string

on data arrival

vbtmpdata = vbtmpdata & winsock1.getdata
if instr(vbtmpdata,"</xml>") ' packet is done...


that gives you an idea :) Good Luck
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:pure032398
ID: 6200558
No acceptable answers :(

I've already figured it out.
0
 
LVL 8

Expert Comment

by:stefanx
ID: 7019420
Hello Pure.
Would you mind sharing what you did to get rid of this problem ?
I hope you didn't take any parsing approach.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7135997
Hi pure,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept BrianGEFF719's comment(s) as an answer.

pure, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7169190
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question