
Winsock Issue - need help
Hi:
if the message is incomplete, cal getdata again later, parse it til
the delimeter, and append to the incomplete message
Similiar if the stream gets more than 1 message, parse it til 1st delimeter
is reached, save the rest as beginning of the 2nd mesage, cal getdata again
later, pase til the 2nd message delimeter is reached, appended to the
beginning of the 2nd mesage.
Quote:
> Hi,
> Currently I'm using VB6 to write a winsock program. My
> main purpose is to connect to external socket engine and
> then receive messages (actually it is a string) from the
> engine.
> The message has been defined in an agreed format and the
> message don't contain any information that telling the
> total length ( or number of byte) of this received message.
> Now I encounter problem when receiving the messages
> because of the high load. The external socket engine will
> send me a lot of messages (same format between each other)
> at a very short period (may be 5 second has 30 messages).
> But I notice that the Winsock will not receive the whole
> 30 messages string in one time and because of this issue,
> it cause my program sometime not working fine.
> For receiving part of my winsock program, I use
> the "Split" function to split receiving string into 30
> messages base on certain delimiter.
> However, my program will sometimes receive incomplete
> message or sometime a message will contain a complete
> message plus an incomplete message.
> Could anyone provide an idea or method to solve this
> problem?
> Very much appreciate if you can help.
> Thank you very much.