From Client to Gateway: Persistent Connection

<< Click to Display Table of Contents >>

Navigation:  The API > JSON API > Real Time Communication >

From Client to Gateway: Persistent Connection

Overview

 

When issuing a command to the gateway (GET or PUT), the normal behavior would be to establish a second connection (the first is the streaming connection where the events are being pushed from the gateway to the client) send out the request to the gateway and then close the connection again.

The next command (whenever it is) would again open a connection, transmit the command and close the connection again.

This approach leads to some overhead in the discussion between the client and the gateway because the HTTP handshake and the meta data have to be transmitted every time with every command.

Things get worse when the connection is secured (TLS) because the overhead of establishing a secure connection each time is by far bigger than the actual payload (the command) itself.

The approach is technically possible but costs a lot of time and thus latency! That means, there will be a delay between the client issuing a command and the EnOcean device to react, which is not appealing to a user or a system at all.

 

Persistent Connection

The solution is to use a persistent connection between the client and the gateway with the HTTP Keep-alive function.