How do I keep HTTP connection open?


I am using Auduino and the includded GPRS network ‘Https.CPP’ demo.

When sending a get or post request to the server a connection channel is opened, data is sent then the connection is closed.

The whole process can take 30 to 60 seconds for GPRS connection to be established with my SIM provider.

So that i can send additional messages without having to reconnect everytime, how can i stop the GPRS connection from being automatically closed after I get a reply from the server?


Most of the remaining client Internet server protocols (HTTP, Telnet, SSH, SMTP) are superimposed over TCP. Thus, the client opens a connection (socket), writes its request (which is transmitted as one or several pockets in the base IP) to the socket, reads the response of the socket (and the response can contain data from several IP packets as well), and then Then the choice is to open the connection for the next request or close it. Pre-KeepAlive HTTP always closed the connection. New clients and servers can leave it open.

The advantage of is that establishing a connection is expensive. Short requests and responses may require more packets than actual data exchange.