コード例 #1
0
 /// <summary>
 /// Event arguments for cluster message events.
 /// </summary>
 /// <param name="Message">Message object</param>
 public ClusterMessageEventArgs(IClusterMessage Message)
 {
     this.message = Message;
 }
コード例 #2
0
 /// <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;
 }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
 /// <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);
 }
コード例 #5
0
ファイル: Component.cs プロジェクト: pkupidura/NETCluster
        /// <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;
        }
コード例 #6
0
ファイル: Component.cs プロジェクト: pkupidura/NETCluster
 /// <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];
 }