-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

NetworkMessageHandlers do not have ID's built into them. All they have
is handleNetworkMessage. This is perfectly clean. It also allows you
to listen to multiple swarms with a single object which has uses for
debugging.

On 02/23/2014 12:48 PM, DavidVorick wrote:
> In src/network/multiplexer.go:
> 
>> + +import ( +	"common" +	"log" +) + +type NetworkMultiplexer
>> struct { +	in    chan common.NetworkMessage +	out   chan
>> idHandler +	hosts map[string][]common.NetworkMessageHandler +} + 
>> +type idHandler struct { +	handler common.NetworkMessageHandler +
>> SwarmId string +}
> 
> What is the purpose of pairing IDs with the NetworkMessageHandler? 
> NetworkMessages have destinations built into them. Also why do we
> send around NetworkMessageHandlers?
> 
> I feel like there is a cleaner way to get the host and the host ID
> when you have a host being added to the map. I'll keep thinking
> about it because I don't have an upfront solution.
> 
> Actually, when you receive the NetworkMessageHandler you should be
> able to call handler.Id() (so make that function a part of the
> interface)
> 
> Also, SwarmId should be Blockchain.
> 
> — Reply to this email directly or view it on GitHub 
> <https://github.com/Siacoin/Sia/pull/24/files#r9976768>.
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTCkpzAAoJEHP1nN3uZoHuKboH/1iwhNjCfjeC1i6lrHr56pDM
8rmpZaT21NKtUqCXx0P/1cKeHTjdeUrkmvP7/25HaW/P6CbsKA3gOzaTZmlATWca
3CsDcQZjml+r88xZMcZ6frEmIe3ojP1FW5AG4zP6Eyv7Cai+NN968pjXaJ7PFlmX
NoeT/c+KZGOrT6IrAOmoomvMXxchgt+PWITbaJYZlgdpNaQpKahxp69ovRBqAy8A
L0FV0k3Nmsg2zHAaLZ0HCGJMNOA/ha1QK2aVF2xXcVUVmYQVZB2prXoeiB5/MPD9
IhxLrf94McRkZhZ8wY0BOBIqu5xZVTUrw2Twc9vYPoFGx6Z6DqEVXDATdkvZ4fY=
=/hv8
-----END PGP SIGNATURE-----