Ok, thanks so much. I made the changes and it works (though I didn't
tested extensively yet).
For reference, this is what I did:
- use of Connection.PostedDataReceived in the PostedData-event
- I don't use LineMode at all (no change if I do)
- Changing the way I was answering to GET commands from SendStream to
AnswerString. I guess my calculation of the size in the header was
wrong. Anyway it simplifies the code.
I did ICS updates frequently, but I realized I didn't checked the new
webserv demo correctly. I didn't know at all for the AnswerString
function, for example. And if my memory is correct I never used
PostedDataReceived either. First time I downloaded ICS was maybe 4 years
ago or something ;-)
Anyway, it works now, it seems.
Thanks to all the people who help me on this, and a special thanks to
Francois (BTW I won't publish the code since this problem is solved...)
Bjørnar Nielsen wrote:
I checked this and I am pretty sure it happens only on second
time connections. When I first do a GET or POST, it always works.
Just out of my head, here is som possible reasons that maybe can cause your
- The header you generate has wrong content length that tells the length of
the body you send.
- You don't provide a content length in your header, in that case the
browser don't know that he has received all data untill you close the
- You don't call Connection.PostedDataReceived when all data is received
If you close the connection, then you should also indicate this happening in
the header ("Connection: Close", instead of "Connection: Keep-Alive")
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