In the following code, is the connection to the remote server held open until close() is called or is it recreated every time read() is called? In the
close()
read()
Try running wireshark or fiddler and look at port 80 with nothing else running. Run your program and see what traffic you get. Should answer your question.