4.1 Establishing a Connection
Node 2 wants to connect to a graph previously created by Node 1. Node 1 is already listening for incoming connections, and its address and port are known by Node 2. Node 2 has never connected to the graph before.
Figure 5: Example of a message exchange when connecting to a graph
To establish the connection, the following steps occur:
Node 2 establishes a TCP connection to Node 1.
Node 2 sends an AUTH_INFO message to Node 1. Because this graph is not using a graph security provider, authentication is complete without any additional messages.
Node 2 sends a CONNECT message to Node 1. Node 2 is not yet listening, so no addresses are contained in the CONNECT message.
Node 1 has no other connections (and, thus, has not reached its maximum neighbor count), so it accepts the new neighbor connection. In response, Node 1 sends a WELCOME message to Node 2.