Definition at line 549 of file Channel.h. References CTR_HEADER_SIZE, HandleError(), ILOG_DEBUG, and mBuffer. Referenced by SendRequest(), and Serve(). 00550 { 00551 int rval; 00552 ILOG_DEBUG("sending " << nrData << " data bytes"); 00553 00554 // assemble CTR header to tell receiver the number of bytes to expect 00555 int nrToSend = nrData + CTR_HEADER_SIZE; 00556 sprintf(mBuffer, "CTR %d\0", nrToSend); 00557 ILOG_DEBUG("send : CTR buf [" << mBuffer << "]"); 00558 00559 // now send the buffer 00560 int nrSend = 0; 00561 char* bufPtr = mBuffer; 00562 do 00563 { 00564 rval = send(sock, bufPtr, nrToSend - nrSend, 0); 00565 if (rval == SOCKET_ERROR) 00566 { 00567 HandleError("SendLarge", true); 00568 return -1; 00569 } 00570 ILOG_DEBUG("sent " << rval << " bytes"); 00571 bufPtr += rval; 00572 nrSend += rval; 00573 } 00574 while (nrSend < nrToSend); 00575 if (nrSend != nrToSend) 00576 { 00577 HandleError("sent incorrect number of bytes!", true); 00578 return -1; 00579 } 00580 return nrSend; 00581 }
Here is the call graph for this function:
|