/// <summary> /// Event arguments for cluster message events. /// </summary> /// <param name="Message">Message object</param> public ClusterMessageEventArgs(IClusterMessage Message) { this.message = Message; }
/// <summary> /// Event arguments for cluster message acknowledgement events. /// </summary> /// <param name="Message">Message object</param> /// <param name="Responses">Message acknowledgement responses</param> /// <param name="State">State object passed on to the original request.</param> public ClusterMessageAckEventArgs(IClusterMessage Message, EndpointAcknowledgement[] Responses, object State) : base(Message) { this.responses = Responses; this.state = State; }
/// <summary> /// Event method sending status info. /// </summary> /// <param name="sender">ignored</param> /// <param name="e">ignored</param> /// <param name="message">XmlMessage to be sent.</param> private void SendStatusMessage(object sender, ElapsedEventArgs e, IClusterMessage message) { if (sender == null) throw new ArgumentNullException("sender"); if (e == null) throw new ArgumentNullException("e"); var responses = SendMessage(message); ProcessMessages(responses); }
/// <summary> /// Helper method for sending message where's no response is expected. /// </summary> /// <param name="message">XmlMessage to be sent.</param> protected void SendMessageNoResponse(IClusterMessage message) { SendMessage(message); }
/// <summary> /// General method for sending messages. Sends single message to server and waits for any responses. /// </summary> /// <param name="message">XmlMessage to be sent.</param> /// <returns>All received messages as XMLDocuments.</returns> protected List<MessagePackage> SendMessage(IClusterMessage message) { var tcpClient = new ConnectionClient(ServerInfo); tcpClient.Connect(); var responses = tcpClient.SendAndWaitForResponses(message); tcpClient.Close(); return responses; }
/// <summary> /// Sends single message to server and waits for single response. /// </summary> /// <param name="message">XmlMessage to be sent.</param> /// <returns>Response from server.</returns> protected MessagePackage SendMessageSingleResponse(IClusterMessage message) { var responses = SendMessage(message); return responses[0]; }