How do I keep HTTP connection open?

Moderators: lily.li, violet, jessie, chao.zhang

Post Reply
phil18
Pre-kindergarten
Pre-kindergarten
Posts: 6
Joined: Fri Feb 12, 2016 5:19 pm

How do I keep HTTP connection open?

Post by phil18 » Thu Jul 07, 2016 7:49 pm

Hello

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?

Thanks.

valeriehenson13
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Fri May 17, 2019 2:08 pm

Re: How do I keep HTTP connection open?

Post by valeriehenson13 » Fri May 17, 2019 2:17 pm

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.

Post Reply