Link to home
Start Free TrialLog in
Avatar of mcainc
mcainc

asked on

VB6 WinSock control packets via SendData coming all at once

I have a function that calls 2 other functions that send packets via the winsock control, the problem is on the receiving ends the packets come in all at once.

how can i separate these two senddata calls so that the receiving end receives 2 DataArrival events rather than 1 combined from my 2 calls?
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

In a nutshell, you can't...not unless you delay the sending of the second transmission until after you have received a manual "ack" transmission signalling that the receiver has already received the first xmit.

Alternatively, you can "mark" the end of the first transmission with a special character sequence so that you can distinguish one transmission from the other even if they come in as one big lump.
What exactly are you trying to do?

Are you trying to copy file(s) to the server and and then SendData via Winsock to the server to process the file(s)?
Avatar of mcainc
mcainc

ASKER

I see, all of the packets have special 2 character "mark" marking the end of the packet...

Which loop do I use to correctly get through this packet chunk (where %% = delimiter)?

example chunk:

packet1%%packet2%%packet3%%
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
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
i made this along time ago in VB6 to solve this same of problem when creating a Instant messenger

http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=52335&lngWId=1