Are sockets kept open when connections are made? 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?
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.