src/worker.cc
// Wait for a connection from a network traffic generation thread.
Wait for a connection from a network traffic generation thread.
Wait for a connection from a network traffic generation thread .
bool NetworkListenThread::GetConnection(int *pnewsock) {
  struct sockaddr_in sa;
  socklen_t size = sizeof(struct sockaddr_in);
  int newsock = accept(sock_, reinterpret_cast<struct sockaddr *>(&sa), &size);
  if (newsock < 0)  {
    logprintf(0, "Process Error: Did not receive connection\n");
    pages_copied_ = 0;
    status_ = false;
    return false;
  }
  *pnewsock = newsock;
  return true;
}
bool NetworkListenThread :: GetConnection ( int * pnewsock ) { struct sockaddr_in sa ; socklen_t size = sizeof ( struct sockaddr_in ) ; int newsock = accept ( sock_ , reinterpret_cast < struct sockaddr * > ( & sa ) , & size ) ; if ( newsock < 0 ) { logprintf ( 0 , " \n " ) ; pages_copied_ = 0 ; status_ = false ; return false ; } * pnewsock = newsock ; return true ; }
Wait for a connection from a network traffic generation thread.
Wait for a connection from a network traffic generation thread .