Changeset 11164


Ignore:
Timestamp:
06/24/11 12:27:51 (13 years ago)
Author:
tbretz
Message:
Switch on keep alive packates with 10s timeouts.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Connection.cc

    r11118 r11164  
    6565
    6666    // AsyncConnect + Deadline
    67     async_connect(endpoint,
     67     async_connect(endpoint,
    6868                  boost::bind(&Connection::ConnectImp,
    6969                              this, ba::placeholders::error,
     
    286286    if (!error)
    287287    {
    288         Info("Connection established to "+host+"...");
     288        set_option(socket_base::keep_alive(true));
     289
     290        const int optval = 10;
     291        // First keep alive after 10s
     292        setsockopt(native(), SOL_TCP, TCP_KEEPIDLE, &optval, sizeof(optval));
     293        // New keep alive after 10s
     294        setsockopt(native(), SOL_TCP, TCP_KEEPINTVL, &optval, sizeof(optval));
     295
     296        Info("Connection established to "+host+"...");
    289297
    290298        fConnectionStatus = kConnected;
Note: See TracChangeset for help on using the changeset viewer.