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


C# Address.ToStringVerboseFormat方法代码示例

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


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

示例1: addToFileServerList

 public void addToFileServerList(Address fsaddress)
 {
     if (fileServerList.Exists (element => element == fsaddress)) {
         Isis.WriteLine ("The Address " + fsaddress.ToStringVerboseFormat () + "already exists ");
     }
     else {
         fileServerList.Add (fsaddress);
     }
 }
开发者ID:piyushmh,项目名称:cloud-filesystem,代码行数:9,代码来源:Global.asax.cs

示例2: handleBootStrappingRequest

        void handleBootStrappingRequest(Group group, OOBHandler oobhandle, InMemoryFileSystem fileSystem, string requestName, Address recvdFrom)
        {
            if (state.currState == eBootStrapState.BootStrappingComplete) {

                Logger.Debug("handleBootStrappingRequest , Received from " + recvdFrom.ToStringVerboseFormat());

                BootStrappingCheckPoint initialStage = null;
                initialStage = new BootStrappingCheckPoint ("Boot Strapping Begin", FileServerComm.BootStrapBegin,
                                                          IsisSystem.GetMyAddress (), SUCCESS,
                                                          0);

                Logger.Debug("Sending a BootStrapping Begin , Response to " + recvdFrom.ToStringVerboseFormat());
                group.RawP2PSend (recvdFrom, FileServerComm.BootStrapBegin, initialStage);

                MemoryMappedFile transferFile = null;
                int currentUserIndex = 0;
                int numberOfUsersCurrentBatch = 0;

                List<string> users = fileSystem.GetInMemoryUserList ();
                InMemoryFileSystem tempFileSystem = new InMemoryFileSystem (false);

                //Yayy Lets Begin Doing Some Boot Strapping
                try {
                    Logger.Debug("Number of Users to BootStrap and Send " + users.Count);
                    while (currentUserIndex < users.Count) {

                        UserFileSystem userfilesys = fileSystem.GetClonedInMemoryUserFileSystem (users [currentUserIndex]);
                        numberOfUsersCurrentBatch++;

                        Logger.Debug("Adding User to the BootStrap : " + users[currentUserIndex]);

                        tempFileSystem.addFSToMapSynchronized (userfilesys, users [currentUserIndex]);
                        currentUserIndex++;

                        if (numberOfUsersCurrentBatch == BatchSize) {
                            //Let's Make a OOB File and Transfer the Data
                            string currentFileName = FileServerComm.getInstance ().transManager.generateTransactionId ();

                            bool operationResult = false;

                            numberOfUsersCurrentBatch = 0;

                            Transaction trans = new Transaction (currentFileName);

                            FileServerComm.getInstance ().transManager.insertTransaction (trans);

                            int writtenBytesLength = 0;
                            transferFile = oobhandle.serializeIntoMemoryMappedFile (currentFileName, tempFileSystem, ref writtenBytesLength);

                            BootStrappingCheckPoint continueBootStrap = null;
                            continueBootStrap = new BootStrappingCheckPoint (currentFileName, FileServerComm.BootStrapContinue,
                                                                           IsisSystem.GetMyAddress (), SUCCESS,
                                                                           writtenBytesLength);
                            List<Address> where = new List<Address>();
                            where.Add(recvdFrom);
                            where.Add (IsisSystem.GetMyAddress ());
                            oobhandle.sendOOBData (group, transferFile, currentFileName, where);

                            trans.waitTillSignalled ();
                            operationResult = !trans.isTimedOut;

                            if (operationResult) {
                                group.RawP2PSend (recvdFrom, FileServerComm.BootStrapContinue, continueBootStrap);
                                trans.waitTillSignalled ();
                                operationResult = !trans.isTimedOut;
                            } else {
                                Logger.Debug ("Sending BootStraping Request Timed Out, Quit Out of BootStrapping partcicipation");
                                return;
                            }
                            tempFileSystem = new InMemoryFileSystem ();
                        }
                    }

                    //Lets Throw out the Remaining Users
                    if (numberOfUsersCurrentBatch != 0) {
                        string currentFileName = FileServerComm.getInstance ().transManager.generateTransactionId ();

                        Transaction trans = new Transaction (currentFileName);
                        FileServerComm.getInstance ().transManager.insertTransaction (trans);

                        bool currentOperationResult = false;

                        int writtenBytesLength = 0;
                        transferFile = oobhandle.serializeIntoMemoryMappedFile (currentFileName, tempFileSystem, ref writtenBytesLength);
                        BootStrappingCheckPoint _continue = null;
                        _continue = new BootStrappingCheckPoint (currentFileName, FileServerComm.BootStrapContinue,
                                                                 IsisSystem.GetMyAddress (), SUCCESS,
                                                                 writtenBytesLength);

                        List<Address> where = new List<Address>();
                        where.Add(recvdFrom);
                        where.Add (IsisSystem.GetMyAddress ());

                        oobhandle.sendOOBData (group, transferFile, currentFileName, where);

                        trans.waitTillSignalled ();
                        currentOperationResult = !trans.isTimedOut;

                        if (currentOperationResult) {
                            group.RawP2PSend (recvdFrom, FileServerComm.BootStrapContinue, _continue);
//.........这里部分代码省略.........
开发者ID:piyushmh,项目名称:cloud-filesystem,代码行数:101,代码来源:BootStrap.cs


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