2007/05/21

回覧板プロトコル

以下のような回覧板プロトコルを組んでみました。

自分的にはまあまあの出来と言ったところでしょうか。


◎クライアントのプログラム

S(i)

{

Nrecany(msg,from_ID);

if((from_ID = Starter1)or(msg = "Did you get a circular notice")){

if(state = "I didn't get a circular notice"){

Bsend(from_ID,MyID,"NO");

}else{

Bsend(from_ID,MyID,"YES");

}

}else{

check("circular notice");

List[MyID]="YES";

if(List[i]="NO"){

Bsend(List[i],Circular_Notice+List[]);

}



if(All_List[]="YES"){

Bsendany("Did you get a circular notice");

Brecany(msg,from_ID);

if(msg = "NO"){

List[] = insert(from_ID)

Bsend(List[i],Circular_Notice+List[]);

}else{

Bsend(Starter1,Circular_Notice+List[]);

};

}

}

0 件のコメント: