コード例 #1
0
 void messagingClient_PeerDisconnected(object sender, ObjectEventArgs<string> e)
 {
     if (clientConnections.ContainsKey(e.Value.ToLower()))
     {
         clientConnections[e.Value.ToLower()].ResetConnection();
     }
 }
コード例 #2
0
        /// <summary>
        /// Handles the MessageReceived event of the MessagingClient and instantiates a new
        /// IClientConnection if no connection responsibel for the message's sender exists
        /// </summary>
        protected virtual void messagingClient_MessageReceived(object sender, ObjectEventArgs<Message> e)
        {
            if (!e.Handled)
            {
                if (!clientConnections.ContainsKey(e.Value.Sender.ToLower()))
                {
                    var connection = AddClientConnection(e.Value.Sender);
                    connection.AcceptConnections = this.AcceptIncomingConnections && !(clientConnections.Count < AllowedConnectionCount);

                    connection.WtlpClient.HandleMessage(e.Value.MessageBody);

                    e.Handled = true;
                }

            }
        }
コード例 #3
0
 private void wtlpClient_MessageReceived(object sender, ObjectEventArgs<ParsingResult> e)
 {
     if (!e.Handled)
     {
         processMessage(e.Value);
         e.Handled = true;
     }
 }
コード例 #4
0
ファイル: Session.cs プロジェクト: ap0llo/wolpertinger
 private void connection_RemoteErrorOccurred(object sender, ObjectEventArgs<RemoteError> e)
 {
     if (!e.Handled)
     {
         Program.ErrorLine(this, "RemoteError: {0} in {1}", e.Value.ErrorCode.ToString(), e.Value.ComponentName);
         e.Handled = true;
     }
 }
コード例 #5
0
 /// <summary>
 /// Handles the MessageReceived event from the underlying messaging client
 /// </summary>
 private void MessagingClient_MessageReceived(object sender, ObjectEventArgs<Message> e)
 {
     if (!e.Handled && e.Value.Sender.ToLower() == this.Recipient.ToLower())
     {
         parseMessage(e.Value.MessageBody);
         e.Handled = true;
     }
 }