X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/869c0cc91d8f6b2bb80026616372d16450b64d9f..c06ef44e7af1571710fd31dd0ab068dd77b1eb2d:/rpc/connection.cc?ds=inline diff --git a/rpc/connection.cc b/rpc/connection.cc index 31ec5fa..8966cc2 100644 --- a/rpc/connection.cc +++ b/rpc/connection.cc @@ -56,7 +56,7 @@ bool connection::send(const string & b) { wpdu_ = {inflight, b, 0}; - if (lossy_ && (random()%100) < lossy_) { + if (std::bernoulli_distribution(lossy_*.01)(global->random_generator)) { IF_LEVEL(1) LOG << "send LOSSY TEST shutdown fd " << fd; shutdown(fd,SHUT_RDWR); }