src/worker.cc
// Send a page, return false if a page was not sent.
Send a page, return false if a page was not sent.
Send a page return false if a page was not sent .
bool NetworkThread::SendPage(int sock, struct page_entry *src) {
  int page_length = sat_->page_length();
  char *address = static_cast<char*>(src->addr);
  int size = page_length;
  while (size) {
    int transferred = send(sock, address + (page_length - size), size, 0);
    if ((transferred == 0) || (transferred == -1)) {
      if (!IsNetworkStopSet()) {
        char buf[256] = "";
        sat_strerror(errno, buf, sizeof(buf));
        logprintf(0, "Process Error: Thread %d, "
                     "Network write failed, bailing. (%s)\n",
                  thread_num_, buf);
        status_ = false;
      }
      return false;
    }
    size = size - transferred;
  }
  return true;
}
bool NetworkThread :: SendPage ( int sock , struct page_entry * src ) { int page_length = sat_ -> page_length ( ) ; char * address = static_cast < char * > ( src -> addr ) ; int size = page_length ; while ( size ) { int transferred = send ( sock , address + ( page_length - size ) , size , 0 ) ; if ( ( transferred == 0 ) || ( transferred == -1 ) ) { if ( ! IsNetworkStopSet ( ) ) { char buf [ 256 ] = " " ; sat_strerror ( errno , buf , sizeof ( buf ) ) ; logprintf ( 0 , " " " \n " , thread_num_ , buf ) ; status_ = false ; } return false ; } size = size - transferred ; } return true ; }
Send a page, return false if a page was not sent.
Send a page return false if a page was not sent .
// Send our data over the network.