2
1
I am curious to know how and where in the source code, the data from stream is actually sent by a node. As per my understanding the following occurs:
ProcessMessage()issues aPushMessage()with appropriate parametersPushMessage()will basically send message headers and parameters into a streamssDatassDatais object ofCDataStreamand defined inCNodeCDataStreamis insrc/stream.hhas no information related to IP or Port
How does the data being pushed to a stream goes into the correct socket in bitcoin working. Only CNode class has information on the network address (IP) and TCP Port. How is this information picked up by the datastream?
Adding more findings:
I found this from https://bitcointalk.org/index.php?topic=41727.0
The socket thread reads the sockets and places data into a CDataStream
associated with each node called vRecv. The Satoshi client uses C++
serialization operators >> and << to read and write to a CDataStream
and then it uses generic routines to move the data between the streams
and sockets
My exact question is where(what) are these mentioned generic routines in source code?