This page shows how to establish a persistent connection to a server using the Connection and Keep-Alive headers. The Connection: keep-alive request header indicates that the client requires a persistent connection. Keep-Alive: timeout = 5, max = 100 sets the timeout value.
The Connection header controls whether the current connection remains open after the transaction.
Persistent connections allow sending multiple requests without opening a new connection for every single transaction.
The connections are persistent by default for HTTP/1.1 clients.
For HTTP/1.0 connections, you need to pass the "Connection: keep-alive" request header to explicitly indicate that you want a persistent connection.
What are TCP timeouts?
TCP stands for Transmission Control Protocol. TCP keepalive timeout defines the period during which the TCP connection checks the FCIP (Fiber Channel over IP) connection. TCP keepalive is a function that sends a probe to the other side when there is no traffic to find out that it is still there and alive.
Generate Code Snippets for Keep Alive Connection Example