I am developing a program on top of a basecode taking care of low level socket programming. The problem seems to be that the only way it knows (apparently) when to stop close the connection is when the amount of bytes received exceed that given in the "Content-length" field. But since that field is not set for many sites I don't know how to tell it to stop. What happens now is that in those cases the entire file is downloaded but the connection is still kept.
There must be something to look for in the incoming data/messages? Thanks.