@ -352,7 +352,7 @@ func (c *MConnection) Send(chID byte, msgBytes []byte) bool {
return false
return false
}
}
c . Logger . Debug ( "Send" , "channel" , chID , "conn" , c , "msgBytes" , fmt . Sprintf ( "%X" , msgBytes ) )
c . Logger . Debug ( "Send" , "channel" , chID , "conn" , c , "msgBytes" , msgBytes )
// Send message to channel.
// Send message to channel.
channel , ok := c . channelsIdx [ chID ]
channel , ok := c . channelsIdx [ chID ]
@ -369,7 +369,7 @@ func (c *MConnection) Send(chID byte, msgBytes []byte) bool {
default :
default :
}
}
} else {
} else {
c . Logger . Debug ( "Send failed" , "channel" , chID , "conn" , c , "msgBytes" , fmt . Sprintf ( "%X" , msgBytes ) )
c . Logger . Debug ( "Send failed" , "channel" , chID , "conn" , c , "msgBytes" , msgBytes )
}
}
return success
return success
}
}
@ -381,7 +381,7 @@ func (c *MConnection) TrySend(chID byte, msgBytes []byte) bool {
return false
return false
}
}
c . Logger . Debug ( "TrySend" , "channel" , chID , "conn" , c , "msgBytes" , fmt . Sprintf ( "%X" , msgBytes ) )
c . Logger . Debug ( "TrySend" , "channel" , chID , "conn" , c , "msgBytes" , msgBytes )
// Send message to channel.
// Send message to channel.
channel , ok := c . channelsIdx [ chID ]
channel , ok := c . channelsIdx [ chID ]
@ -640,7 +640,7 @@ FOR_LOOP:
break FOR_LOOP
break FOR_LOOP
}
}
if msgBytes != nil {
if msgBytes != nil {
c . Logger . Debug ( "Received bytes" , "chID" , pkt . PacketMsg . ChannelID , "msgBytes" , fmt . Sprintf ( "%X" , msgBytes ) )
c . Logger . Debug ( "Received bytes" , "chID" , pkt . PacketMsg . ChannelID , "msgBytes" , msgBytes )
// NOTE: This means the reactor.Receive runs in the same thread as the p2p recv routine
// NOTE: This means the reactor.Receive runs in the same thread as the p2p recv routine
c . onReceive ( byte ( pkt . PacketMsg . ChannelID ) , msgBytes )
c . onReceive ( byte ( pkt . PacketMsg . ChannelID ) , msgBytes )
}
}