Changeset 230 in flair-src for trunk


Ignore:
Timestamp:
Mar 12, 2018, 4:32:00 PM (7 years ago)
Author:
Sanahuja Guillaume
Message:

modifs timeout tcpsocket

Location:
trunk/lib
Files:
3 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  }
  • trunk/lib/FlairSensorActuator/src/HostEthController.cpp

    r214 r230  
    149149  connectionEstablishedMutex->GetMutex();
    150150  if (!connectionEstablished &&
    151       controlSocket->Connect(targetPort, targetAddress, 10)) {
     151      controlSocket->Connect(targetPort, targetAddress, 100000000)) {//100ms
    152152    Thread::Info("Connected to %s:%d\n", targetAddress.c_str(), targetPort);
    153153    SendControllerInfo();
  • trunk/lib/FlairSensorActuator/src/SimuUs.cpp

    r224 r230  
    3131namespace sensor {
    3232
    33 //control part
    3433SimuUs::SimuUs(string name, uint32_t modelId,uint32_t deviceId,
    3534               uint8_t priority)
Note: See TracChangeset for help on using the changeset viewer.