neoneo-go/_pkg.dev/connmgr/readme.md
Roman Khimov ddd1d92ff1 pkg: hide it by moving to _pkg.dev
The idea here is to preserve the history of `dev` branch development and its
code when merging with the `master`. Later this code could be moved into the
masters code where appropriate.
2019-08-20 18:39:50 +03:00

834 B
Executable file

Package - Connection Manager

Responsibility

  • Manages the active, failed and pending connections for the node.

Features

  • Takes an Request, dials it and logs information based on the connectivity.

  • Retry failed connections.

  • Removable address source. The connection manager does not manage addresses, only connections.

Usage

The following methods are exposed from the Connection manager:

  • Connect(r *Request) : This takes a Request object and connects to it. It follow the same logic as NewRequest() however instead of getting the address from the datasource given upon initialisation, you directly feed the address you want to connect to.

  • Disconnect(addrport string) : Given an address:port, this will disconnect it, close the connection and remove it from the connected and pending list, if it was there.