|
-
Apr 6th, 2006, 02:14 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Winsock DataArrival Event Problem
Hi,
I'm writing a program that exchanges data between a host and a group of clients using TCP.
The problem I'm having is that when a client/host sends data to the host/client, if the size of the data stream exceeds the MTU, I am only getting the first MTU number of bytes.
So I am only able to receive the first DataArrival event, but not the subsequent ones (since they seem to never happen).
Outline of my code:
On the sending side, I break the data stream into chunks equal to the MTU or smaller, and send them in bursts (controlled by a timer set to 100mS intervals).
On the receiving side, I receive the data in the DataArrival Event handler into a TEXTBOX and then handover to another sub for processing (I am not using the CALL statement to execute the processor sub, just the name of the sub with the socket index parameter). The purpose of the textbox is to concatenate chuncks as they arrive.
The sub that does the processing initially copies the contents of the textbox into a string, and then uses the string thereafter. Since I'm only getting the first chunk, my stream is truncated and confuses the processing algorithm.
I suspect that it has something to do with being inside a procedure when the event takes place (I think it's since VB doesn't allow events while executing some procedures). I have put plenty of DOEVENTS statements into my code, but it still isn't working.
Does anyone have a detailed reference I can read that explains this aspect of EVENTS, and if possible, in relation to the Winsock control?
My code is about 800 lines or so long, so I didn't want to post it here. But if someone is interested enough, I can do so. (Or send via email attachment)
Cheers,
Nap.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|