Http Keep Alive

<< Click to Display Table of Contents >>

Navigation:  The API > JSON API > Real Time Communication > From Client to Gateway: Persistent Connection >

Http Keep Alive



Starting with HTTP 1.1 the Persistent Connection has been introduced.

When a request from a client to a server has a ("Connection", "keep-alive") in the HTTP header, the server will not close the underlying TCP Connection for a certain period of time even though the request from the client has been completed. When the client issues another request within that time period, the TCP stack will normally take the already open connection to the server and use it to transmit the request. So there is no waste of time (latency!) for the client when sending commands to the gateway.

This may vary depending on the operating system and the programming language you are using. Please refer to the documentation of you underlying TCP-Stack to ensure you are able to use the Keep-alive function.


Gateway Settings

The gateway settings for keep-alive are:

timeout= <NoLimit>. It means the gateway will keep the connection open.

max= <NoLimit>. It means how many requests you can do over the same connection before the gateway will force a close of the connection.