relaying messages and closing a connection to our peer on
the P2P network.</p><divclass="fullcomment"><divclass="comment cmt"><p>This actor is responsible for creating a connection,
relaying messages and closing a connection to our peer on
the P2P network. This is the actor that directly interacts
with the p2p network. It's responsibly is to deal with low
level .TCP messages.</p><p>If the client receives a <ahref="../../core/p2p/NetworkMessage.html"name="org.bitcoins.core.p2p.NetworkMessage"id="org.bitcoins.core.p2p.NetworkMessage"class="extype">NetworkMessage</a>, from a
it serializes the message to it to a <ahref="https://doc.akka.io/api/akka/2.6.18/akka/util/ByteString.html"name="akka.util.ByteString"id="akka.util.ByteString"class="extype">akka.util.ByteString</a> and then
sends it to the internal <code>manager</code> which streams the data to our peer
on the Bitcoin network.</p><p>If the client receives a <spanname="Tcp.Received"class="extype">Tcp.Received</span> message, it means we have received
a message from our peer on the Bitcoin P2P network. This means we try to parse
the bytes into a <ahref="../../core/p2p/NetworkMessage.html"name="org.bitcoins.core.p2p.NetworkMessage"id="org.bitcoins.core.p2p.NetworkMessage"class="extype">NetworkMessage</a>.
If we successfully parse the message we relay that message to the
that created the Client Actor.</p><p>In this class you will see a 'unalignedBytes' value passed around in a lot of methods.
This is because we cannot assume that a Bitcoin P2P message aligns with a TCP packet.
For instance, a large block message (up to 4MB in size)
CANNOT fit in a single TCP packet. This means we must cache
the bytes and wait for the rest of them to be sent.
</p></div><dlclass="paramcmts block"><dtclass="param">initPeerMsgHandlerReceiver</dt><ddclass="cmt"><p>The place we send messages that we successfully parsed
from our peer on the P2P network. This is mostly likely
a <ahref="peer/PeerMessageSender.html"name="org.bitcoins.node.networking.peer.PeerMessageSender"id="org.bitcoins.node.networking.peer.PeerMessageSender"class="extype">org.bitcoins.node.networking.peer.PeerMessageSender</a></p></dd></dl></div></li></ol></div><divclass="values members"><h3>Value Members</h3><ol><liclass="indented0 "name="org.bitcoins.node.networking.P2PClient"group="Ungrouped"fullComment="no"data-isabs="false"visbl="pub"><aid="P2PClient"class="anchorToMember"></a><aid="P2PClient:P2PClient"class="anchorToMember"></a><spanclass="permalink"><ahref="../../../../org/bitcoins/node/networking/P2PClient$.html"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">object</span></span><spanclass="symbol"><ahref="P2PClient$.html"title=""><spanclass="name">P2PClient</span></a><spanclass="result"> extends <spanname="org.bitcoins.node.P2PLogger"class="extype">P2PLogger</span> with <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java/io/Serializable.html#java.io.Serializable"name="java.io.Serializable"id="java.io.Serializable"class="extype">Serializable</a></span></span></li></ol></div></div><divid="inheritedMembers"></div><divid="groupedMembers"><divname="Ungrouped"class="group"><h3>Ungrouped</h3></div></div></div><divid="tooltip"></div><divid="footer"></div></body></div></div></div></body></html>