Add recv_msg function to SwarmNetwork.