epoll 模型原理详解以及实例(4)

bool send_data(int connfd, char *pbuffer, unsigned int &len,int flag)
{
  if ((connfd < 0) || (0  == pbuffer))
  {
      return false;
  }

int result = 0;
  int remain_size = (int) len;
  int send_size = 0;
  const char *p = pbuffer;

time_t start_time = time(NULL);
  int time_out = 3;

do
  {
      if (time(NULL) > start + time_out)
      {
        return false;
      }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/07056860132b8a0bd306cfbb0a535cbb.html