void messagingClient_PeerDisconnected(object sender, ObjectEventArgs<string> e) { if (clientConnections.ContainsKey(e.Value.ToLower())) { clientConnections[e.Value.ToLower()].ResetConnection(); } }
/// <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; } } }
private void wtlpClient_MessageReceived(object sender, ObjectEventArgs<ParsingResult> e) { if (!e.Handled) { processMessage(e.Value); e.Handled = true; } }
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; } }
/// <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; } }