本文整理汇总了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);
}
}
示例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);
//.........这里部分代码省略.........