Ignore:
Timestamp:
03/23/12 10:22:17 (13 years ago)
Author:
tbretz
Message:
Changed the default interval from 55s to 25s. Made it an option.
File:
1 edited

Legend:

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

    r12965 r13191  
    4545class ConnectionWeather : public Connection
    4646{
    47     int  fState;
     47    int      fState;
     48    uint16_t fInterval;
    4849
    4950    bool fIsVerbose;
     
    209210        PostRequest();
    210211
    211         fKeepAlive.expires_from_now(boost::posix_time::seconds(55));
     212        fKeepAlive.expires_from_now(boost::posix_time::seconds(fInterval));
    212213        fKeepAlive.async_wait(boost::bind(&ConnectionWeather::HandleRequest,
    213214                                          this, dummy::error));
     
    268269    {
    269270        fIsVerbose = b;
     271    }
     272
     273    void SetInterval(uint16_t i)
     274    {
     275        fInterval = i;
    270276    }
    271277
     
    457463
    458464        fWeather.SetVerbose(!conf.Get<bool>("quiet"));
     465        fWeather.SetInterval(conf.Get<uint16_t>("interval"));
    459466
    460467        return -1;
     
    480487        ("addr,a",  var<string>("www.magic.iac.es:80"),  "Network address of Cosy")
    481488        ("quiet,q", po_bool(true),  "Disable printing contents of all received messages (except dynamic data) in clear text.")
     489        ("interval,i", var<uint16_t>(25), "Interval between two server requests in seconds")
    482490        ;
    483491
Note: See TracChangeset for help on using the changeset viewer.