[Csci551-talk] Packet drops in TA code
Affan, Syed
asyed at usc.edu
Tue Apr 26 22:05:22 PDT 2005
Hi all,
As brought to my notice by Michael Stephens (thanks :)), the TA code is
not dropping packets, if they are specified, only in the selectnSend()
function, in the clientNode.cpp. Please every body include that portion
in the code by modifying the line of code as follows:
Change
sendto(listenSockfd, &downloadReq,sizeof(SClntSegReq),0,(sockaddr
*)(&sendAddr), sizeof(sendAddr));
TO:
bool drop = ( (float)rand()/(float)RAND_MAX <
myConfig.configInfo.pkt_drop ); // random drop
if (drop) {
pktsDropped++;
}
else {
sendto(listenSockfd,
&downloadReq,sizeof(SClntSegReq),0,(sockaddr *)(&sendAddr),
sizeof(sendAddr));
pktsSent++;
}
Best Regards,
Affan, Syed.
More information about the Csci551-talk
mailing list