Changeset 230 in flair-src for trunk/lib/FlairCore/src/TcpSocket.cpp


Ignore:
Timestamp:
03/12/18 16:32:00 (6 years ago)
Author:
Sanahuja Guillaume
Message:

modifs timeout tcpsocket

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/TcpSocket.cpp

    r213 r230  
    139139      // now block with a timeout
    140140      struct timeval tv;
    141       if (timeout != 0) {
    142         tv.tv_sec = timeout / 1000; // timeout is in ms
    143         tv.tv_usec = (timeout % 1000) * 1000;
     141      if (timeout != 0) {// timeout is in ns
     142        tv.tv_sec = timeout /((Time)1000000000);
     143        tv.tv_usec = (timeout%((Time)1000000000))/1000;
     144        Printf("%i %i\n",tv.tv_sec,tv.tv_usec);
    144145      }
    145146      fd_set wset;
     
    190191  if (!success) {
    191192    close(socket);
    192     // Info("Debug: Connect to %s:%d failed\n", distantAddress.c_str(),
    193     // distantPort);
     193     //Info("Debug: Connect to %s:%d failed\n", distantAddress.c_str(), distantPort);
    194194    return false;
    195195  } else {
     
    197197    this->distantPort = distantPort;
    198198    this->distantAddress = distantAddress;
    199     // Info("Debug: Connect to %s:%d succeeded\n", distantAddress.c_str(),
    200     // distantPort);
     199     //Info("Debug: Connect to %s:%d succeeded\n", distantAddress.c_str(), distantPort);
    201200    return true;
    202201  }
Note: See TracChangeset for help on using the changeset viewer.