4 years, 8 months ago.

TCPSocket: Can you send multiple HTTP requests on a TCPSocket while only calling 'connect()' once?

I am using TCPSocket to make HTTP requests. I only call TCPSocket::Connect once, before my main loop. The first request sends fine and receives back the data it should. However all subsequent request fail in someway.

Somtimes they fail with a 400 error - Bad Verb, other times no data is returned at all and finally it stops even sending any data.

Does the socket connection need to be closed and re-opened after every request?

Be the first to answer this question.