reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
WsTransport.cxx
Go to the documentation of this file.
1#if defined(HAVE_CONFIG_H)
2#include "config.h"
3#endif
4
5#include "rutil/compat.hxx"
6#include "rutil/Data.hxx"
7#include "rutil/Socket.hxx"
8#include "rutil/Logger.hxx"
12
13#include <utility>
14
15#define RESIPROCATE_SUBSYSTEM Subsystem::TRANSPORT
16
17using namespace std;
18using namespace resip;
19
21 IpVersion version, const Data& pinterface,
23 Compression &compression,
24 unsigned transportFlags,
25 std::shared_ptr<WsConnectionValidator> connectionValidator,
26 std::shared_ptr<WsCookieContextFactory> cookieContextFactory)
27: TcpBaseTransport(fifo, portNum, version, pinterface, socketFunc, compression, transportFlags),
28 WsBaseTransport(connectionValidator, cookieContextFactory)
29{
31
33
34 InfoLog (<< "Creating WS transport host=" << pinterface
35 << " port=" << mTuple.getPort()
36 << " ipv4=" << (version == V4) );
37
38 mTxFifo.setDescription("WsTransport::mTxFifo");
39}
40
42WsTransport::createConnection(const Tuple& who, Socket fd, bool server)
43{
45 Connection* conn = new WsConnection(this,who, fd, mCompression, mConnectionValidator, server);
46 return conn;
47}
48
49/* ====================================================================
50 *
51 * Copyright 2012 Doubango Telecom. All rights reserved.
52 *
53 * Redistribution and use in source and binary forms, with or without
54 * modification, are permitted provided that the following conditions
55 * are met:
56 *
57 * 1. Redistributions of source code must retain the above copyright
58 * notice, this list of conditions and the following disclaimer.
59 *
60 * 2. Redistributions in binary form must reproduce the above copyright
61 * notice, this list of conditions and the following disclaimer in
62 * the documentation and/or other materials provided with the
63 * distribution.
64 *
65 * 3. Neither the name of the author(s) nor the names of any contributors
66 * may be used to endorse or promote products derived from this software
67 * without specific prior written permission.
68 *
69 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS "AS IS" AND
70 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
71 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
72 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
73 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
74 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
75 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
76 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
77 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
78 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
79 * SUCH DAMAGE.
80 *
81 * ====================================================================
82 *
83 *
84 */
85
#define InfoLog(args_)
Definition Logger.hxx:131
#define resip_assert_not_null(x)
Handles cross-platform sockets compatibility.
Connection implements, via sockets, ConnectionBase for managed connections.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
A templated, threadsafe message-queue class.
Definition Fifo.hxx:16
virtual void init()
Performs constructor activities that depend on virtual functions specified by derived classes.
Compression & mCompression
Represents a network address.
Definition Tuple.hxx:59
void setType(TransportType type)
Definition Tuple.hxx:123
int getPort() const
Definition Tuple.cxx:466
std::shared_ptr< WsConnectionValidator > mConnectionValidator
Connection * createConnection(const Tuple &who, Socket fd, bool server=false) override
Makes new Connection using provided socket.
WsTransport(Fifo< TransactionMessage > &fifo, int portNum, IpVersion version, const Data &interfaceObj, AfterSocketCreationFuncPtr socketFunc=nullptr, Compression &compression=Compression::Disabled, unsigned transportFlags=0, std::shared_ptr< WsConnectionValidator >=nullptr, std::shared_ptr< WsCookieContextFactory >=std::make_shared< BasicWsCookieContextFactory >())
This file is used to handle compatibility fixes/tweaks so reSIProcate can function on multiple platfo...
dcm! – add UnusedChecking(_enum) below;
void(* AfterSocketCreationFuncPtr)(Socket s, int transportType, const char *file, int line)
Definition Socket.hxx:107
int Socket
Definition Socket.hxx:94
IpVersion
An enumeration of IP versions.