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


C# IServiceAddress.ToString方法代码示例

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


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

示例1: Set

        public void Set(String path, IServiceAddress rootAddress)
        {
            string rootAddrStr = null;
            if (rootAddress != null)
                rootAddrStr = rootAddress.ToString();

            dictionary.SetValue(path, rootAddrStr);
        }
开发者ID:ikvm,项目名称:cloudb,代码行数:8,代码来源:PathRootTable.cs

示例2: ToString

 public string ToString(IServiceAddress address)
 {
     return address.ToString();
 }
开发者ID:erpframework,项目名称:cloudb,代码行数:4,代码来源:TcpServiceAddressHandler.cs

示例3: ProcessSingleRoot

        private Message ProcessSingleRoot(IEnumerable<Message> outputStream, IServiceAddress rootServer)
        {
            IMessageProcessor processor = connector.Connect(rootServer, ServiceType.Root);
            IEnumerable<Message> inputStream = processor.Process(outputStream);
            Message lastM = null;
            foreach (Message m in inputStream) {
                lastM = m;
                if (m.HasError) {
                    // If it's a connection failure, inform the service tracker and throw
                    // service not available exception.
                    if (IsConnectionFailMessage(m)) {
                        serviceTracker.ReportServiceDownClientReport(rootServer, ServiceType.Root);
                        throw new ServiceNotConnectedException(rootServer.ToString());
                    }

                    string errorSource = m.Error.Source;
                    // Rethrow InvalidPathInfoException locally,
                    if (errorSource.Equals("Deveel.Data.Net.InvalidPathInfoException")) {
                        throw new InvalidPathInfoException(m.ErrorMessage);
                    }
                }
            }
            return lastM;
        }
开发者ID:erpframework,项目名称:cloudb,代码行数:24,代码来源:NetworkTreeSystem.cs

示例4: RegisterBlockServer

        private void RegisterBlockServer(IServiceAddress blockServerAddress)
        {
            // Get the block server uid,
            Message message = new Message("serverGUID");

            // Connect to the block server,
            IMessageProcessor processor = connector.Connect(blockServerAddress, ServiceType.Block);
            IEnumerable<Message> response = processor.Process(message.AsStream());
            Message rm = null;
            foreach (Message m in response) {
                if (m.HasError)
                    throw new ApplicationException(m.ErrorMessage);

                rm = m;
            }

            long serverGuid = (long) rm.Arguments[0].Value;

            // Add lookup for this server_guid <-> service address to the db,
            managerDb.SetValue("block.sguid." + serverGuid, blockServerAddress.ToString());
            managerDb.SetValue("block.addr." + blockServerAddress, serverGuid.ToString());

            // TODO: Block discovery on the introduced machine,

            // Set the status and guid
            BlockServiceInfo blockServer = new BlockServiceInfo(serverGuid, blockServerAddress);
            // Add it to the map
            lock (blockServersMap) {
                blockServersMap[serverGuid] = blockServer;
                blockServersList.Add(blockServer);
                PersistBlockServers(blockServersList);
            }
        }
开发者ID:erpframework,项目名称:cloudb,代码行数:33,代码来源:ManagerService.cs

示例5: OnBindingWithManager

        protected override void OnBindingWithManager(IServiceAddress managerAddress)
        {
            // Contains the root properties,
            string propFile = Path.Combine(basePath, "00.properties");
            using(FileStream fileStream = new FileStream(propFile, FileMode.OpenOrCreate, FileAccess.ReadWrite)) {
                // Write the manager server address to the properties file,
                Properties p = new Properties();
                if (fileStream.Length > 0)
                    p.Load(fileStream);

                p.SetProperty("manager_address", managerAddress.ToString());

                fileStream.SetLength(0);
                p.Store(fileStream, null);
                fileStream.Close();
            }
        }
开发者ID:ikvm,项目名称:cloudb,代码行数:17,代码来源:FileSystemRootService.cs


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