Hi everytbody,
I'm experiencing some problems trying to asynchronously read data from a
Socket object. What I do now is:
1) call th BeginReceive(...) method on the Socket object;
2) within the asynchronous callback method, call the EndReceive method,
getting the number of read bytes (stored in a variable called rb)
3) if (rb>0) I can suppose there are still some other bytes to be read,
so call again the BeginReceive(...) method, else performe what you need
to do. I sould implement an Http layer over this Socket (as I must be
"compliant" with fw1.1 I cannot use HttpWebRequest class :-((( ).
Testing thi small "server" I found this:
- sometimes it gots *stuck* trying to read from the client (Client-side
I've uset an HttpWebRequest and I've written the payload data on it's
RequestStream, but I used also a web form within my browser and I got
the same behaviour), that happens actually when the server shoud read 0
bytes... and the client gets disconnected (because of a timeout exceeded).
Can anyone help me? (if you need I can paste here some code).
Thanks in advance (and sorry for my English)!
Whishing you all a *great* 2007,
Giulio - from Italy