Hello,

I've a server and a client app. which communicate through a TCP based
protocoll I designed.

The server get's requests which in OnDataAvailable are received into a
1500 Byte sized array (most time the app. will run on a LAN) whose
contents is copied into a larger buffer then since the request could be
fragmented.

The larger buffer is processed within the context of OnDataAvailable.
If I send requests manually via clicking on a button in the client all
works well, but not if the client sends say 1.000 requests in a loop.

The server gets out of sync then because the buffer contains garbage
now. But where does it come? Can OnDataAvailable be called while it is
already running? And if yes, how to prevent this? Is using critical
sections a good idea here?

The processing of the larger puffer is to check validity of the request
and extract the real request out of my data format. The real request is
appended to a queue then which gets processed by a seperate thread.

Greetings

Markus
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to