KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a little program sends http request and gets response with TCP protocol. My request format; GET / HTTP/1.0 Host: somewebsite.com {two new line} I read response line by line from socket (using NetworkStream and StreamReader in c#) until I find content-length header. I store the length, then continue reading until find an empty line. Then create a buffer with the length and receive the rest of response. But some reponses does not have a content-length header. So my approach fails. If I don't know how many bytes I should receive, when I should stop?
Tags (comma-separated)
Save Edits
Cancel