The only way to keep socket open is to use http 1.1 protocol and supply a connection:keep-alive request header. The lifetime will depend on the server. In the case of logitech media center, it closes the socket after 75 secs of inactivity. If you want to do this, you will need to process the content length response headers so that you can send multiple http request/response pairs across the same socket. This is known as request pipelining.