当前位置: 首页>>代码示例>>C#>>正文


C# ITransport.Oneway方法代码示例

本文整理汇总了C#中ITransport.Oneway方法的典型用法代码示例。如果您正苦于以下问题:C# ITransport.Oneway方法的具体用法?C# ITransport.Oneway怎么用?C# ITransport.Oneway使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITransport的用法示例。


在下文中一共展示了ITransport.Oneway方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RestoreTransport

        protected void RestoreTransport(ITransport t)
        {
            Tracer.Info("Restoring previous transport connection.");
            t.Start();

            // Send information to the broker - informing it we are a fault tolerant client
            t.Oneway(new ConnectionControl() { FaultTolerant = true });
            stateTracker.DoRestore(t);

            Tracer.Info("Sending queued commands...");
            Dictionary<int, Command> tmpMap = null;
            lock(((ICollection) requestMap).SyncRoot)
            {
                tmpMap = new Dictionary<int, Command>(requestMap);
            }

            foreach(Command command in tmpMap.Values)
            {
                if(command.IsMessageAck)
                {
                    Tracer.Debug("Stored MessageAck being dropped as stale.");
                    OnCommand(this, new Response() { CorrelationId = command.CommandId });
                    continue;
                }

                t.Oneway(command);
            }
        }
开发者ID:Redi0,项目名称:meijing-ui,代码行数:28,代码来源:FailoverTransport.cs

示例2: DoRestoreTempDestinations

 /// <summary>
 /// </summary>
 /// <param name="transport"></param>
 /// <param name="connectionState"></param>
 protected void DoRestoreTempDestinations(ITransport transport, ConnectionState connectionState)
 {
     // Restore the connection's temp destinations.
     foreach(DestinationInfo destinationInfo in connectionState.TempDestinations)
     {
         transport.Oneway(destinationInfo);
     }
 }
开发者ID:ThorTech,项目名称:apache-nms,代码行数:12,代码来源:ConnectionStateTracker.cs

示例3: DoRestoreTransactions

 private void DoRestoreTransactions(ITransport transport, ConnectionState connectionState)
 {
     AtomicCollection<TransactionState> transactionStates = connectionState.TransactionStates;
     foreach(TransactionState transactionState in transactionStates)
     {
         foreach(Command command in transactionState.Commands)
         {
             transport.Oneway(command);
         }
     }
 }
开发者ID:ThorTech,项目名称:apache-nms,代码行数:11,代码来源:ConnectionStateTracker.cs

示例4: DoRestoreProducers

 /// <summary>
 /// </summary>
 /// <param name="transport"></param>
 /// <param name="sessionState"></param>
 protected void DoRestoreProducers(ITransport transport, SessionState sessionState)
 {
     // Restore the session's producers
     foreach(ProducerState producerState in sessionState.ProducerStates)
     {
         transport.Oneway(producerState.Info);
     }
 }
开发者ID:ThorTech,项目名称:apache-nms,代码行数:12,代码来源:ConnectionStateTracker.cs

示例5: DoRestoreSessions

        /// <summary>
        /// </summary>
        /// <param name="transport"></param>
        /// <param name="connectionState"></param>
        protected void DoRestoreSessions(ITransport transport, ConnectionState connectionState)
        {
            // Restore the connection's sessions
            foreach(SessionState sessionState in connectionState.SessionStates)
            {
                transport.Oneway(sessionState.Info);

                if(RestoreProducers)
                {
                    DoRestoreProducers(transport, sessionState);
                }

                if(RestoreConsumers)
                {
                    DoRestoreConsumers(transport, sessionState);
                }
            }
        }
开发者ID:ThorTech,项目名称:apache-nms,代码行数:22,代码来源:ConnectionStateTracker.cs

示例6: DoRestore

        public void DoRestore(ITransport transport)
        {
            // Restore the connections.
            foreach(ConnectionState connectionState in connectionStates.Values)
            {
                ConnectionInfo info = connectionState.Info;
                info.FailoverReconnect = true;
                transport.Oneway(info);

                DoRestoreTempDestinations(transport, connectionState);

                if(RestoreSessions)
                {
                    DoRestoreSessions(transport, connectionState);
                }

                if(RestoreTransaction)
                {
                    DoRestoreTransactions(transport, connectionState);
                }
            }
            //now flush messages
            foreach(Message msg in messageCache.Values)
            {
                transport.Oneway(msg);
            }
        }
开发者ID:ThorTech,项目名称:apache-nms,代码行数:27,代码来源:ConnectionStateTracker.cs

示例7: DoRestoreConsumers

        /// <summary>
        /// </summary>
        /// <param name="transport"></param>
        /// <param name="sessionState"></param>
        protected void DoRestoreConsumers(ITransport transport, SessionState sessionState)
        {
            // Restore the session's consumers but possibly in pull only (prefetch 0 state) till
            // recovery completes.

            ConnectionState connectionState = connectionStates[sessionState.Info.SessionId.ParentId];
            bool connectionInterruptionProcessingComplete =
                connectionState.ConnectionInterruptProcessingComplete;

            // Restore the session's consumers
            foreach(ConsumerState consumerState in sessionState.ConsumerStates)
            {
                ConsumerInfo infoToSend = consumerState.Info;

                if(!connectionInterruptionProcessingComplete && infoToSend.PrefetchSize > 0 && transport.WireFormat.Version > 5)
                {
                    infoToSend = consumerState.Info.Clone() as ConsumerInfo;
                    connectionState.RecoveringPullConsumers.Add(infoToSend.ConsumerId, consumerState.Info);
                    infoToSend.PrefetchSize = 0;
                    if(Tracer.IsDebugEnabled)
                    {
                        Tracer.Debug("restore consumer: " + infoToSend.ConsumerId +
                                     " in pull mode pending recovery, overriding prefetch: " +
                                     consumerState.Info.PrefetchSize);
                    }
                }

                if(Tracer.IsDebugEnabled)
                {
                    Tracer.Debug("restore consumer: " + infoToSend.ConsumerId);
                }

                transport.Oneway(infoToSend);
            }
        }
开发者ID:ThorTech,项目名称:apache-nms,代码行数:39,代码来源:ConnectionStateTracker.cs

示例8: ConnectionInterruptProcessingComplete

        public void ConnectionInterruptProcessingComplete(ITransport transport, ConnectionId connectionId)
        {
            ConnectionState connectionState = connectionStates[connectionId];
            if(connectionState != null)
            {
                connectionState.ConnectionInterruptProcessingComplete = true;

                Dictionary<ConsumerId, ConsumerInfo> stalledConsumers = connectionState.RecoveringPullConsumers;
                foreach(KeyValuePair<ConsumerId, ConsumerInfo> entry in stalledConsumers)
                {
                    ConsumerControl control = new ConsumerControl();
                    control.ConsumerId = entry.Key;
                    control.Prefetch = entry.Value.PrefetchSize;
                    control.Destination = entry.Value.Destination;
                    try
                    {
                        if(Tracer.IsDebugEnabled)
                        {
                            Tracer.Debug("restored recovering consumer: " + control.ConsumerId +
                                         " with: " + control.Prefetch);
                        }
                        transport.Oneway(control);
                    }
                    catch(Exception ex)
                    {
                        if(Tracer.IsDebugEnabled)
                        {
                            Tracer.Debug("Failed to submit control for consumer: " + control.ConsumerId +
                                         " with: " + control.Prefetch + "Error: " + ex.Message);
                        }
                    }
                }
                stalledConsumers.Clear();
            }
        }
开发者ID:ThorTech,项目名称:apache-nms,代码行数:35,代码来源:ConnectionStateTracker.cs

示例9: ConnectionInterruptProcessingComplete

        public void ConnectionInterruptProcessingComplete(ITransport transport, ConnectionId connectionId)
        {
			ConnectionState connectionState = null;

			if(connectionStates.TryGetValue(connectionId, out connectionState))
            {
                connectionState.ConnectionInterruptProcessingComplete = true;

				lock(((ICollection) connectionState.RecoveringPullConsumers).SyncRoot)
				{
					foreach(KeyValuePair<ConsumerId, ConsumerInfo> entry in connectionState.RecoveringPullConsumers)
					{
						ConsumerControl control = new ConsumerControl();
						control.ConsumerId = entry.Key;
						control.Prefetch = entry.Value.PrefetchSize;
						control.Destination = entry.Value.Destination;
						try
						{
							if(Tracer.IsDebugEnabled)
							{
								Tracer.Debug("restored recovering consumer: " + control.ConsumerId +
											 " with: " + control.Prefetch);
							}
							transport.Oneway(control);
						}
						catch(Exception ex)
						{
							if(Tracer.IsDebugEnabled)
							{
								Tracer.Debug("Failed to submit control for consumer: " + control.ConsumerId +
											 " with: " + control.Prefetch + "Error: " + ex.Message);
							}
						}
					}
					connectionState.RecoveringPullConsumers.Clear();
				}
            }
        }
开发者ID:Redi0,项目名称:meijing-ui,代码行数:38,代码来源:ConnectionStateTracker.cs

示例10: disposeOf

		protected void disposeOf(ITransport transport, ProducerInfo producer)
		{
			transport.Oneway(new RemoveInfo() { ObjectId = producer.ProducerId });
		}
开发者ID:Redi0,项目名称:meijing-ui,代码行数:4,代码来源:FailoverTransportTest.cs


注:本文中的ITransport.Oneway方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。