/[resiprocate]/main/reflow/FlowDtlsTimerContext.cxx
ViewVC logotype

Contents of /main/reflow/FlowDtlsTimerContext.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9650 - (show annotations) (download)
Thu May 3 22:46:50 2012 UTC (7 years, 8 months ago) by sgodin
File MIME type: text/plain
File size: 3023 byte(s)
-added some missing #include "config.h" directives

1 #ifdef HAVE_CONFIG_H
2 #include "config.h"
3 #endif
4
5 #ifdef USE_SSL
6
7 #include <boost/bind.hpp>
8
9 #include <rutil/Log.hxx>
10 #include <rutil/Logger.hxx>
11
12 #include "FlowDtlsTimerContext.hxx"
13 #include "FlowManagerSubsystem.hxx"
14
15 using namespace flowmanager;
16 using namespace resip;
17 using namespace dtls;
18 using namespace std;
19
20 #define RESIPROCATE_SUBSYSTEM FlowManagerSubsystem::FLOWMANAGER
21
22 FlowDtlsTimerContext::FlowDtlsTimerContext(asio::io_service& ioService) :
23 mIOService(ioService)
24 {
25 }
26
27 void
28 FlowDtlsTimerContext::addTimer(dtls::DtlsTimer *timer, unsigned int durationMs)
29 {
30 resip::SharedPtr<asio::deadline_timer> deadlineTimer(new asio::deadline_timer(mIOService));
31 deadlineTimer->expires_from_now(boost::posix_time::milliseconds(durationMs));
32 deadlineTimer->async_wait(boost::bind(&FlowDtlsTimerContext::handleTimeout, this, timer, asio::placeholders::error));
33 mDeadlineTimers[timer] = deadlineTimer;
34 //InfoLog(<< "FlowDtlsTimerContext: starting timer for " << durationMs << "ms.");
35 }
36
37 void
38 FlowDtlsTimerContext::handleTimeout(dtls::DtlsTimer *timer, const asio::error_code& errorCode)
39 {
40 if(!errorCode)
41 {
42 //InfoLog(<< "FlowDtlsTimerContext: timer expired!");
43 timer->fire();
44 }
45 else
46 {
47 ErrLog(<< "Timer error: " << errorCode.message());
48 }
49 mDeadlineTimers.erase(timer);
50 }
51
52 #endif
53
54 /* ====================================================================
55
56 Copyright (c) 2007-2008, Plantronics, Inc.
57 All rights reserved.
58
59 Redistribution and use in source and binary forms, with or without
60 modification, are permitted provided that the following conditions are
61 met:
62
63 1. Redistributions of source code must retain the above copyright
64 notice, this list of conditions and the following disclaimer.
65
66 2. Redistributions in binary form must reproduce the above copyright
67 notice, this list of conditions and the following disclaimer in the
68 documentation and/or other materials provided with the distribution.
69
70 3. Neither the name of Plantronics nor the names of its contributors
71 may be used to endorse or promote products derived from this
72 software without specific prior written permission.
73
74 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
75 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
76 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
77 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
78 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
79 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
80 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
81 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
82 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
83 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
84 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
85
86 ==================================================================== */

Properties

Name Value
svn:eol-style native
svn:mime-type text/plain

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27