<blockquote>
  <p>The bitcoin protocol says that any given node is connected to at least 8 other nodes.</p>
</blockquote>

<p>Right.</p>

<blockquote>
  <p>Does that mean that when a client connects to a node and learns about new peers... will the client keep the socket open and wait on recv?</p>
</blockquote>

<p>No, since this is about connection between peer nodes, not about clients.</p>

<blockquote>
  <p>Or does it just record the new peers and closes the sockets and opens a new connection when there is new data to be received or sent?</p>
</blockquote>

<p>Nodes try to retain at least eight connections to peer nodes so that they can track the flow of new transactions and blocks on the network. Establishing a reliable set of stable connections to at least eight peer nodes is the objective here.</p>

CC BY-SA 4.0
2018-09-05T01:59:19.390Z
2018-09-05T01:59:19.390Z
David Schwartz
<p>The bitcoin protocol says that any given node is connected to at least 8 other nodes. Does that mean that when a client connects to a node and learns about new peers... will the client keep the socket open and wait on recv? Or does it just record the new peers and closes the sockets and opens a new connection when there is new data to be received or sent?</p>

<development><network>
Are sockets kept open when connections are made?
Bhargav
# Are sockets kept open when connections are made?

(Asked by: username_0 on 2018-09-04)

The bitcoin protocol says that any given node is connected to at least 8 other nodes. Does that mean that when a client connects to a node and learns about new peers... will the client keep the socket open and wait on recv? Or does it just record the new peers and closes the sockets and opens a new connection when there is new data to be received or sent?

**Tags:** development, network


---

## 1 answers

### Answer by username_1 on 2018-09-05. Score: 2

> The bitcoin protocol says that any given node is connected to at least 8 other nodes.

Right.

> Does that mean that when a client connects to a node and learns about new peers... will the client keep the socket open and wait on recv?

No, since this is about connection between peer nodes, not about clients.

> Or does it just record the new peers and closes the sockets and opens a new connection when there is new data to be received or sent?

Nodes try to retain at least eight connections to peer nodes so that they can track the flow of new transactions and blocks on the network. Establishing a reliable set of stable connections to at least eight peer nodes is the objective here.


---

