Detect network changes, initial code. Actions to be developed. #2

This commit is contained in:
Kleissner
2021-03-02 00:28:03 +01:00
parent c34adc472c
commit 213c724016
7 changed files with 134 additions and 3 deletions

View File

@@ -70,6 +70,11 @@ func (peer *PeerInfo) cmdResponse(msg *packet2) {
// cmdPing handles an incoming ping message
func (peer *PeerInfo) cmdPing(msg *packet2) {
if peer == nil {
// Unexpected incoming ping, reply with announce message
// TODO
return
}
peer.send(&PacketRaw{Command: CommandPong})
//fmt.Printf("Incoming ping from %s on %s\n", msg.connection.Address.String(), msg.connection.Address.String())
}