~ubuntu-branches/ubuntu/saucy/resiprocate/saucy-proposed

« back to all changes in this revision

Viewing changes to tfm/tfdum/TfdTestSipEndPoint.cxx

  • Committer: Package Import Robot
  • Author(s): Daniel Pocock
  • Date: 2012-05-17 19:29:59 UTC
  • Revision ID: package-import@ubuntu.com-20120517192959-vv00m77isztdy64q
Tags: upstream-1.8.2
ImportĀ upstreamĀ versionĀ 1.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "tfm/tfdum/TfdTcpTransport.hxx"
 
2
#include "tfm/tfdum/TfdTestSipEndPoint.hxx"
 
3
#include "rutil/Logger.hxx"
 
4
 
 
5
using namespace resip;
 
6
 
 
7
#define RESIPROCATE_SUBSYSTEM resip::Subsystem::TEST
 
8
 
 
9
TfdTestSipEndPoint::TfdTestSipEndPoint(const resip::Uri& from,
 
10
                                       const resip::Uri& contact, 
 
11
                                       const resip::Uri& outboundProxy,
 
12
                                       const resip::Data& interfaceObj,
 
13
                                       resip::Security* security)
 
14
   : TestSipEndPoint(from, contact, outboundProxy, false, interfaceObj, security)
 
15
{
 
16
   setTransport(new TfdTcpTransport(mIncoming, mContact.uri().port(), V4, interfaceObj));
 
17
}
 
18
      
 
19
TfdTestSipEndPoint::TfdTestSipEndPoint(const resip::Uri& contact, 
 
20
                                       const resip::Uri& outboundProxy,
 
21
                                       const resip::Data& interfaceObj,
 
22
                                       resip::Security* security)
 
23
   : TestSipEndPoint(contact, outboundProxy, false, interfaceObj, security)
 
24
{
 
25
   setTransport(new TfdTcpTransport(mIncoming, mContact.uri().port(), V4, interfaceObj));
 
26
}
 
27
 
 
28
 
 
29
TfdTestSipEndPoint::~TfdTestSipEndPoint()
 
30
{
 
31
}
 
32
 
 
33
void 
 
34
TfdTestSipEndPoint::removeConnections()
 
35
{
 
36
   DebugLog(<< "TfdTestSipEndPoint::removeConnections");
 
37
   assert(dynamic_cast<TfdTcpTransport*>(mTransport));
 
38
   dynamic_cast<TfdTcpTransport*>(mTransport)->removeConnections();
 
39
}      
 
40
 
 
41
TfdTestSipEndPoint::TerminateConnection::TerminateConnection(TfdTestSipEndPoint* from)
 
42
   : mEndPoint(*from)
 
43
{
 
44
}
 
45
 
 
46
void 
 
47
TfdTestSipEndPoint::TerminateConnection::operator()() 
 
48
 
49
   go(); 
 
50
}
 
51
 
 
52
void 
 
53
TfdTestSipEndPoint::TerminateConnection::operator()(boost::shared_ptr<Event> event)
 
54
{
 
55
   go();
 
56
}
 
57
 
 
58
void
 
59
TfdTestSipEndPoint::TerminateConnection::go()
 
60
{
 
61
   mEndPoint.removeConnections();
 
62
}
 
63
 
 
64
resip::Data
 
65
TfdTestSipEndPoint::TerminateConnection::toString() const
 
66
{
 
67
   return mEndPoint.getName() + ".terminateConnection()";
 
68
}
 
69
 
 
70
TfdTestSipEndPoint::Action* 
 
71
TfdTestSipEndPoint::terminateConnection()
 
72
{
 
73
   return new TerminateConnection(this);
 
74
}
 
75
 
 
76
 
 
77
 
 
78
// Copyright 2005 Purplecomm, Inc.
 
79
/*
 
80
  Copyright (c) 2005, PurpleComm, Inc. 
 
81
  All rights reserved.
 
82
 
 
83
  Redistribution and use in source and binary forms, with or without modification,
 
84
  are permitted provided that the following conditions are met:
 
85
 
 
86
  * Redistributions of source code must retain the above copyright notice, this
 
87
  list of conditions and the following disclaimer.
 
88
  * Redistributions in binary form must reproduce the above copyright notice,
 
89
  this list of conditions and the following disclaimer in the documentation
 
90
  and/or other materials provided with the distribution.
 
91
  * Neither the name of PurpleComm, Inc. nor the names of its contributors may
 
92
  be used to endorse or promote products derived from this software without
 
93
  specific prior written permission.
 
94
 
 
95
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 
96
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
97
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 
98
  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
 
99
  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
100
  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 
101
  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 
102
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 
103
  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
104
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
105
*/