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


C# Address.ToString方法代码示例

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


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

示例1: Ready

 private void Ready()
 {
     Receive<SendState>(msg =>
     {
         _cluster.SendCurrentClusterState(Self);
     });
     Receive<ClusterEvent.CurrentClusterState>(state =>
     {
         //_hub.ClusterState(state, _cluster.SelfAddress);
     });
     Receive<RemoveMe>(msg => {
         _logger.Warning("[l] Monitor stopping; Issuing a Cluster.Leave() command for following address: {0}", _cluster.SelfAddress);
         _cluster.Leave(_cluster.SelfAddress);
     });
     Receive<MemberLeave>(msg => {
         Address add = new Address(msg.Protocol, msg.System, msg.Host, msg.Port);
         _logger.Warning("[l] Forcing Member to leave cluster: {0}", add.ToString());
         _cluster.Leave(add);
     });
     Receive<MemberDown>(msg => {
         Address add = new Address(msg.Protocol, msg.System, msg.Host, msg.Port);
         _logger.Warning("[l] Forcing the Member down: {0}", add.ToString());
         _cluster.Down(add);
     });
 }
开发者ID:jurek333,项目名称:CoreWars,代码行数:25,代码来源:ClusterMonitor.cs

示例2: RemoveClusterMember

        public void RemoveClusterMember(Address address)
        {
            using (var cmd = new SQLiteCommand(@"DELETE FROM cluster_nodes WHERE member_address = @addr", _connectionFactory()))
            using (var tx = cmd.Connection.BeginTransaction())
            {
                cmd.Transaction = tx;
                var addr = address.ToString();
                cmd.Parameters.Add("@addr", DbType.String);
                cmd.Parameters["@addr"].Value = addr;

                cmd.ExecuteNonQuery();
                tx.Commit();
            }
        }
开发者ID:,项目名称:,代码行数:14,代码来源:

示例3: AddClusterMember

        public void AddClusterMember(Address address)
        {
            using (var cmd = new SQLiteCommand(@"INSERT INTO cluster_nodes(member_address) VALUES (@addr)", _connectionFactory()))
            using (var tx = cmd.Connection.BeginTransaction())
            {
                cmd.Transaction = tx;
                var addr = address.ToString();
                cmd.Parameters.Add("@addr", DbType.String);
                cmd.Parameters["@addr"].Value = addr;

                cmd.ExecuteNonQuery();
                tx.Commit();
            }
        }
开发者ID:,项目名称:,代码行数:14,代码来源:

示例4: Ready

        private void Ready()
        {
            Receive<RemoveMember>(mem =>
            {
                _logger.Warning("Service stopping; Issuing a Cluster.Leave() command for following address: {0}", Cluster.SelfAddress);
                Cluster.Leave(Cluster.SelfAddress);
            });

            Receive<MemberDown>(address =>
            {
                Address add = new Address(address.Protocol, address.System, address.Host, address.Port);
                _logger.Warning("Forcing the Member down: {0}", add.ToString());
                Cluster.Down(add);
            });

            Receive<MemberLeave>(address =>
            {
                Address add = new Address(address.Protocol, address.System, address.Host, address.Port);
                _logger.Warning("Forcing Member to leave cluster: {0}", add.ToString());
                Cluster.Leave(add);
            });
        }
开发者ID:Danthar,项目名称:Akka.Cluster.Monitor,代码行数:22,代码来源:ClusterHelper.cs

示例5: Ready

        private void Ready()
        {
            Receive<RemoveMember>(mem =>
            {
                _logger.Info("Removing Member: {0}", Cluster.SelfAddress);
                Cluster.Leave(Cluster.SelfAddress);
            });

            Receive<MemberDown>(address =>
            {
                Address add = new Address(address.Protocol, address.System, address.Host, address.Port);
                _logger.Info("Forcing the Member down: {0}", add.ToString());
                Cluster.Down(add);
            });

            Receive<MemberLeave>(address =>
            {
                Address add = new Address(address.Protocol, address.System, address.Host, address.Port);
                _logger.Info("Forcing Member to leave cluster: {0}", add.ToString());
                Cluster.Leave(add);
            });
        }
开发者ID:rogeralsing,项目名称:Akka.Cluster.Monitor,代码行数:22,代码来源:ClusterHelper.cs

示例6: Encode

 /// <summary>
 /// URL-encodes an actor <see cref="Address"/>. Used when generating the names
 /// of some system remote actors.
 /// </summary>
 public static string Encode(Address address)
 {
     return HttpUtility.UrlEncode(address.ToString(), Encoding.UTF8);
 }
开发者ID:jweimann,项目名称:akka.net,代码行数:8,代码来源:Remoting.cs

示例7: CreateEndpoint

 private InternalActorRef CreateEndpoint(Address recipientAddress, AkkaProtocolTransport transport,
     Address localAddressToUse, long? refuseUid)
 {
     string escapedAddress = Uri.EscapeDataString(recipientAddress.ToString());
     string name = string.Format("endpointWriter-{0}-{1}", escapedAddress, endpointId++);
     InternalActorRef actor =
         Context.ActorOf(
             Props.Create(
                 () => new EndpointActor(localAddressToUse, recipientAddress, transport.Transport, settings)),
             name);
     return actor;
 }
开发者ID:Badmoonz,项目名称:akka.net,代码行数:12,代码来源:EndpointManager.cs


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