Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify Connection Establishment and Restoring #36

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1932,14 +1932,20 @@ The downloadable file of the package.
<h1 id="connection-management">Connection Management</h1>


<h2 id="establishing-connection">Establishing Connection</h2>
## 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.

<h2 id="closing-connection">Closing Connection</h2>


Expand All @@ -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).


<h2 id="duplicate-connections">Duplicate Connections</h2>


Expand Down Expand Up @@ -2044,8 +2058,7 @@ deliver to the Agent and send it as soon as the connection to the Agent is
available.


<h2 id="throttling">Throttling</h2>

## Throttling

When the Server is overloaded and is unstable to process the AgentToServer
message it SHOULD respond with an ServerToAgent message with error_response
Expand Down