public void Initialize(IClientPeerWrapper clientPeerWrapper)
        {
            ClientPeerWrapper = clientPeerWrapper;

            SetEventsSenderHandler();
            SetOperationRequestsHandler();

            OnInitialized();
        }
        private void RemovePeerLogic(IClientPeerWrapper peerLogic, DisconnectReason reason, string details)
        {
            lock (locker)
            {
                var ip   = peerLogic.Peer.ConnectionInformation.Ip;
                var port = peerLogic.Peer.ConnectionInformation.Port;

                LogUtils.Log(details == string.Empty
                    ? $"A peer {ip}:{port} has been disconnected. Reason: {reason}"
                    : $"A peer {ip}:{port} has been disconnected. Reason: {reason} Details: {details}");

                peerLogics.Remove(peerLogic.PeerId);
            }
        }
        public void AddPeerLogic(IClientPeerWrapper peerLogic)
        {
            lock (locker)
            {
                if (peerLogics.ContainsKey(peerLogic.PeerId))
                {
                    LogUtils.Log(MessageBuilder.Trace($"A peer id {peerLogic.PeerId} has been already registered."));
                    return;
                }

                peerLogic.Peer.PeerDisconnectionNotifier.Disconnected += (reason, details) => RemovePeerLogic(peerLogic, reason, details);
                peerLogics.Add(peerLogic.PeerId, peerLogic);
            }
        }