Conversation
|
|
||
| //bind to listen incoming connections | ||
| tcpManager ! Bind(self, bindAddress, options = Nil, pullMode = false) | ||
| tcpManager ! Bind(self, bindAddress, options = Nil, pullMode = true) |
There was a problem hiding this comment.
Unless I am misunderstanding, I thought pull mode was purposely disabled here since to enable it would cause the network controller to respond to the TCP manager each time a new connection is attempted. But since each attempt to connect to peers is independent, there is no need to block subsequent connection requests.
Relevant documentation on pullMode in bind command
https://doc.akka.io/docs/akka/2.6.9/io-tcp.html?language=java#pull-mode-reading-for-inbound-connections
pullMode on connect makes sense to me as we want the PeerConnectionHandlers between remote peers to fully process and acknowledge messages to maintain a stable connection.
There was a problem hiding this comment.
Sorry for the late reply. Pull mode is supposed to throttle reading, not to throttle the number of connection requests. However, in Akka, both are throttled, so pull mode was disabled on purpose to not throttle the number of incoming connections.
In this pull request, pull mode is enabled to throttle only reading, and at the same time, sending a message to TCP manager to always accept new connections.
Three minor updates
remoteAddressas peer's address, if there is no address info in it'sPeerInfo