How does CDataStream data find its way into a socket?
CNode has a method SocketSendData() which pushes all the serialized data into the socket.

https://github.com/bitcoin/bitcoin/search?utf8=%E2%9C%93&amp;q=SocketSendData&amp;type=Code