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?
Programming Languages-OtherVisual Basic Classic

Avatar of undefined
Last Comment
stevel_utec

8/22/2022 - Mon
Mike Tomlinson

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.
jkaios

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)?
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%%
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ASKER CERTIFIED SOLUTION
Mike Tomlinson

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
stevel_utec

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