diff --git a/README.md b/README.md index fa73685..a382838 100644 --- a/README.md +++ b/README.md @@ -2071,14 +2071,20 @@ The downloadable file of the package.

Connection Management

-

Establishing Connection

+## Establishing Connection - -The Agent connects to the Server by establishing an HTTP connection, then +The Agent connects to the Server by establishing an HTTP(S) connection, then upgrading the connection to WebSocket as defined by WebSocket standard. After -the WebSocket connection is open the Agent MUST send the first +the WebSocket connection is established the Agent MUST send the first [status report](#status-reporting) and expect a response to it. +If the Agent is unable to establish a WebSocket connection to the Server it +SHOULD retry connection attempts and use exponential backoff strategy with +jitter to avoid overwhelming the Server. + +When retrying connection attempts the Agent SHOULD honour any +[throttling](#throttling) responses it receives from the Server. +

Closing Connection

@@ -2097,6 +2103,14 @@ To close a connection the Server MUST then send a WebSocket [Close](https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.1) control frame and follow the procedure defined by WebSocket standard. +## Restoring Connection + +If an established WebSocket connection is broken (disconnected) unexpectedly the +Agent SHOULD immediately try to re-connect. If the re-connection fails the Agent +SHOULD continue connection attempts with backoff as described in +[Establishing Connection](#establishing-connection). + +

Duplicate Connections

@@ -2183,8 +2197,7 @@ deliver to the Agent and send it as soon as the connection to the Agent is available. -

Throttling

- +## Throttling When the Server is overloaded and is unstable to process the AgentToServer message it SHOULD respond with an ServerToAgent message with error_response