diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2015-06-08 02:03:31 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2015-06-09 02:05:34 +0900 |
| commit | 99cd73c0926f0c07d27777fde2f15816e8040030 (patch) | |
| tree | 7c6a077b0590c49029c76686afb9c2ab1d00bb6d /src/UDPTrackerClient.cc | |
| parent | 2874f6ab095a30a4d297cdc85fa3730bec41b1c2 (diff) | |
Replace timer facility with chrono lib
Diffstat (limited to 'src/UDPTrackerClient.cc')
| -rw-r--r-- | src/UDPTrackerClient.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/UDPTrackerClient.cc b/src/UDPTrackerClient.cc index c21ae01c..41e52f37 100644 --- a/src/UDPTrackerClient.cc +++ b/src/UDPTrackerClient.cc @@ -368,9 +368,9 @@ namespace { struct TimeoutCheck { bool operator()(const std::shared_ptr<UDPTrackerRequest>& req) const { - int t = req->dispatched.difference(now); + auto t = req->dispatched.difference(now); if(req->failCount == 0) { - if(t >= 15) { + if(t >= std::chrono::seconds(15)) { switch(req->action) { case UDPT_ACT_CONNECT: A2_LOG_INFO(fmt("UDPT resend CONNECT to %s:%u transaction_id=%u", @@ -396,7 +396,7 @@ struct TimeoutCheck { return false; } } else { - if(t >= 60) { + if(t >= std::chrono::minutes(1)) { switch(req->action) { case UDPT_ACT_CONNECT: A2_LOG_INFO(fmt("UDPT timeout CONNECT to %s:%u transaction_id=%u", @@ -475,7 +475,7 @@ UDPTrackerConnection* UDPTrackerClient::getConnectionId return nullptr; } if((*i).second.state == UDPT_CST_CONNECTED && - (*i).second.lastUpdated.difference(now) > 60) { + (*i).second.lastUpdated.difference(now) > std::chrono::minutes(1)) { connectionIdCache_.erase(i); return nullptr; } else { |
