freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

cbn協(xié)議實現(xiàn)(c語言)-資料下載頁

2025-05-08 13:29本頁面
  

【正文】 pnext=q。 pprev=qprev。 qprevnext=p。 qprev=p。 } } } //打印事件列表 void printevlist() { struct event *q。 int i。 printf(\n 事件列表如下 :\n)。 for(q = evlist。 q!=NULL。 q=qnext) { printf( 事件時間 : %f, 類型 : %d 實體 : %d\n,qevtime,qevtype,qeventity)。 } printf(\n)。 } //啟動計時器 void starttimer(int AorB,float increment) { struct event *q。 struct event *evptr。 if (TRACE2) printf(\nA: 啟動計時器 : 在 %f 開始定時 \n,time)。 /* 友好的:檢查計時器是否早已開始計時,如果是,則發(fā)出警告 */ /* for (q=evlist。 q!=NULL amp。amp。 qnext!=NULL。 q = qnext) */ for (q=evlist。 q!=NULL 。 q = qnext) if ( (qevtype==TIMER_INTERRUPT amp。amp。 qeventity==AorB) ) { //printf(Warning: attempt to start a timer that is already started\n)。 return。 } /* 創(chuàng)建事件當(dāng)超時發(fā)生 */ evptr = (struct event *)malloc(sizeof(struct event))。 evptrevtime = time + increment。 evptrevtype = TIMER_INTERRUPT。 evptreventity = AorB。 insertevent(evptr)。 } //停止計時器 /* called by students routine to cancel a previouslystarted timer */ void stoptimer(int AorB) /* A or B is trying to stop timer */ { struct event *q,*qold。 if (TRACE2) printf(\nA: STOP TIMER:停止計時器 \n)。 /* for (q=evlist。 q!=NULL amp。amp。 qnext!=NULL。 q = qnext) */ for (q=evlist。 q!=NULL 。 q = qnext) if ( (qevtype==TIMER_INTERRUPT amp。amp。 qeventity==AorB) )/* 改變此事件 */ { if (qnext==NULL amp。amp。 qprev==NULL) evlist=NULL。 /* 移動第一個且這一個事件到事件清單 */ else if (qnext==NULL) /* end of list there is one in front */ qprevnext = NULL。 else if (q==evlist) /* front of list there must be event after */ { qnextprev=NULL。 evlist = qnext。 } else /* middle of list */ { qnextprev = qprev。 qprevnext = qnext。 } free(q)。 return。 } //printf(Warning: unable to cancel your timer. It wasn39。t running.\n)。 } //向第三層發(fā)送 信息 /************************** TOLAYER3 ***************/ void tolayer3(int AorB,struct pkt packet) { struct pkt *mypktptr。 struct event *evptr,*q。 float lastime, x, jimsrand()。 int i。 ntolayer3++。 /* 模擬丟失 : */ if (jimsrand() lossprob) { nlost++。 if (TRACE0) printf( 發(fā)送到第三層 : 包丟失。 \n)。 return。 } /* make a copy of the packet student just gave me since he/she may decide */ /* to do something with the packet after we return back to him/her */ mypktptr = (struct pkt *)malloc(sizeof(struct pkt))。 mypktptrseqnum = 。 mypktptracknum = 。 mypktptrchecksum = 。 for (i=0。 i20。 i++) mypktptrpayload[i] = [i]。 if (TRACE2) { printf( 發(fā)送到第三層 : 序號 : %d, 確認(rèn) : %d, 檢查 : %d , mypktptrseqnum,mypktptracknum, mypktptrchecksum)。 for (i=0。 i20。 i++) printf(%c,mypktptrpayload[i])。 printf()。 } /* 創(chuàng)建將來事件當(dāng)包到達另一端 */ evptr = (struct event *)malloc(sizeof(struct event))。 evptrevtype = FROM_LAYER3。 /* packet will pop out from layer3 包將從第三層彈出 */ evptreventity = (AorB) % 2。 /* 事件將在其他實體出現(xiàn) */ evptrpktptr = mypktptr。 /* 存儲指針復(fù)制的包 */ /* 最后,計算包到達另一端的時間 重新整理中媒體 , 以確定包到達是在 1 到 10 單元時間之間,之后, 最近到達的包能正確的到達目的地 */ lastime = time。 /* for (q=evlist。 q!=NULL amp。amp。 qnext!=NULL。 q = qnext) */ for (q=evlist。 q!=NULL 。 q = qnext) if ( (qevtype==FROM_LAYER3 amp。amp。 qeventity==evptreventity) ) lastime = qevtime。 evptrevtime = lastime + 1 + 9*jimsrand()。 /* simulate corruption: */ if (jimsrand() corruptprob) { ncorrupt++。 if ( (x = jimsrand()) .75) mypktptrpayload[0]=39。Z39。 /* corrupt payload */ else if (x .875) mypktptrseqnum = 999999。 else mypktptracknum = 999999。 if (TRACE0) printf( 向第三層發(fā)送信息 : 包被敗壞 \n)。 } //if (TRACE2) //printf( TOLAYER3: scheduling arrival on other side\n)。 insertevent(evptr)。 } //向第五層發(fā)送信息 /************************** TOLAYER5 ***************/ void tolayer5(int AorB,char datasent[20]) { int i。 if (TRACE2) { printf( 向第五層發(fā)送信息 : 數(shù)據(jù)收到 )。 for (i=0。 i20。 i++) printf(%c,datasent[i])。 printf(\n)。 } } 修改程序運行截圖: :
點擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1