Winsock Issue - need help 
Author Message
 Winsock Issue - need help

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.



Mon, 16 Aug 2004 17:55:28 GMT  
 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.



Mon, 16 Aug 2004 20:49:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Winsock application issue: NEED HELP

2. Winsock application issue: NEED HELP!!!

3. Need help - ASP build issue

4. Need help on Read Only issue

5. Need help with ADO recordset sorting issue

6. Help needed on VB6 issue

7. annoying clipboard issue...need some help

8. Need help with network programming issues

9. Need help with two issues

10. Need some help. More trivial issues :)

11. Help needed on two issues

12. In dire need of some Help----Formatting issues

 

 
Powered by phpBB® Forum Software