reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
RemotePeer.cxx
Go to the documentation of this file.
1
#include "
RemotePeer.hxx
"
2
#include <time.h>
3
4
using namespace
std;
5
6
namespace
reTurn
{
7
8
RemotePeer::RemotePeer
(
const
StunTuple
& peerTuple,
unsigned
short
channel,
unsigned
int
timeoutSeconds) :
9
mPeerTuple(peerTuple),
10
mChannel(channel),
11
mChannelConfirmed(false),
12
mExpires(time(0)+timeoutSeconds),
13
mTimeoutSeconds(timeoutSeconds)
14
{
15
}
16
17
void
18
RemotePeer::refresh
()
19
{
20
mExpires = time(0)+mTimeoutSeconds;
21
}
22
23
bool
24
RemotePeer::isExpired
()
25
{
26
if
(time(0) > mExpires)
27
{
28
return
true
;
29
}
30
return
false
;
31
}
32
33
}
// namespace
34
35
36
/* ====================================================================
37
38
Copyright (c) 2007-2008, Plantronics, Inc.
39
All rights reserved.
40
41
Redistribution and use in source and binary forms, with or without
42
modification, are permitted provided that the following conditions are
43
met:
44
45
1. Redistributions of source code must retain the above copyright
46
notice, this list of conditions and the following disclaimer.
47
48
2. Redistributions in binary form must reproduce the above copyright
49
notice, this list of conditions and the following disclaimer in the
50
documentation and/or other materials provided with the distribution.
51
52
3. Neither the name of Plantronics nor the names of its contributors
53
may be used to endorse or promote products derived from this
54
software without specific prior written permission.
55
56
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
57
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
58
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
59
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
60
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
61
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
62
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
63
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
64
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
65
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
66
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67
68
==================================================================== */
RemotePeer.hxx
reTurn::RemotePeer::refresh
void refresh()
Definition
RemotePeer.cxx:18
reTurn::RemotePeer::isExpired
bool isExpired()
Definition
RemotePeer.cxx:24
reTurn::RemotePeer::RemotePeer
RemotePeer(const StunTuple &peerTuple, unsigned short channel, unsigned int timeoutSeconds)
Definition
RemotePeer.cxx:8
reTurn::StunTuple
Definition
StunTuple.hxx:24
reTurn
Definition
AsyncSocketBase.cxx:16
reTurn
RemotePeer.cxx
Generated by
1.9.8