コード例 #1
0
ファイル: BitChat.cs プロジェクト: spthaolt/BitChatClient
 private void RaiseEventPeerSecureChannelException(SecureChannelException ex)
 {
     _syncCxt.Post(PeerSecureChannelExceptionCallback, ex);
 }
コード例 #2
0
ファイル: BitChat.cs プロジェクト: spthaolt/BitChatClient
 private void _network_VirtualPeerSecureChannelException(BitChatNetwork sender, SecureChannelException ex)
 {
     if (PeerSecureChannelException != null)
         RaiseEventPeerSecureChannelException(ex);
 }
コード例 #3
0
        private void _chat_PeerSecureChannelException(BitChat sender, SecureChannelException ex)
        {
            string peerInfo;

            if (ex.PeerCertificate == null)
                peerInfo = "[" + ex.PeerEP.ToString() + "]";
            else
                peerInfo = ex.PeerCertificate.IssuedTo.Name + " <" + ex.PeerCertificate.IssuedTo.EmailAddress.Address + "> [" + ex.PeerEP.ToString() + "]";

            string desc;

            if (ex.Code == SecureChannelCode.RemoteError)
                desc = "RemoteError: " + (ex.InnerException as SecureChannelException).Code.ToString();
            else
                desc = ex.Code.ToString();

            AddMessage(new ChatMessageInfoItem("Secure channel with peer '" + peerInfo + "' encountered '" + desc + "' exception.", DateTime.Now));
        }