Extend comment on the role of Connection.InputHandler

This commit is contained in:
Ivan Vilata-i-Balaguer 2016-04-11 11:08:08 +02:00
parent 9b9fd678a8
commit 5d78918fb2

View File

@ -585,7 +585,9 @@ public class Connection implements MessageListener {
// InputHandler
///////////////////////////////////////////////////////////////////////////////////////////
// Runs in same thread as Connection
// Runs in same thread as Connection, receives a message, performs several checks on it
// (including throttling limits, validity and statistics)
// and delivers it to the message listener given in the constructor.
private static class InputHandler implements Runnable {
private static final Logger log = LoggerFactory.getLogger(InputHandler.class);
@ -730,13 +732,13 @@ public class Connection implements MessageListener {
if (!(message instanceof KeepAliveMessage))
connection.statistic.updateLastActivityTimestamp();
// First a seed node gets a message form a peer (PreliminaryDataRequest using
// AnonymousMessage interface) which does not has its hidden service
// published, so does not know its address. As the IncomingConnection does not has the
// First a seed node gets a message from a peer (PreliminaryDataRequest using
// AnonymousMessage interface) which does not have its hidden service
// published, so it does not know its address. As the IncomingConnection does not have the
// peersNodeAddress set that connection cannot be used for outgoing messages until we
// get the address set.
// At the data update message (DataRequest using SendersNodeAddressMessage interface)
// after the HS is published we get the peers address set.
// after the HS is published we get the peer's address set.
// There are only those messages used for new connections to a peer:
// 1. PreliminaryDataRequest