protected override async Task ProcessItemAsync(RpcMessage <PeeringStatus> rpcMessage) { try { PeerInfo peerInfo = _peerManager.UpdatePeerStatus(rpcMessage.PeerId, rpcMessage.Content); Session session = _peerManager.OpenSession(peerInfo); // Mothra seems to be raising all incoming RPC (sent as request and as response) // with requestResponseFlag 0, so check here if already have the status so we don't go into infinite loop // => So use session details instead of the status message //if (statusRpcMessage.Direction == RpcDirection.Request) if (session.Direction == ConnectionDirection.Out) { // If it is a dial out, we must have already sent the status request and this is the response await _synchronizationManager.OnStatusResponseReceived(rpcMessage.PeerId, rpcMessage.Content); } else { await _synchronizationManager.OnStatusRequestReceived(rpcMessage.PeerId, rpcMessage.Content); } } catch (Exception ex) { if (_logger.IsError()) { Log.HandleRpcStatusError(_logger, rpcMessage.PeerId, ex.Message, ex); } } }