diff --git a/README.md b/README.md index e1ef8c6..3d46a84 100644 --- a/README.md +++ b/README.md @@ -1932,14 +1932,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

@@ -1958,6 +1964,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

@@ -2044,8 +2058,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