Link to home
Start Free TrialLog in
Avatar of pure032398
pure032398

asked on

Winsock packetsize problems

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-
Avatar of wpsjr1
wpsjr1

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
Avatar of pure032398

ASKER

--> append the packets together ???
--> parse on some characters ???


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

-PK-
ASKER CERTIFIED SOLUTION
Avatar of BrianGEFF719
BrianGEFF719
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No acceptable answers :(

I've already figured it out.
Hello Pure.
Would you mind sharing what you did to get rid of this problem ?
I hope you didn't take any parsing approach.
Avatar of DanRollins
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
Comment from expert accepted as answer

Computer101
E-E Moderator