reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
KurentoManager.cxx
Go to the documentation of this file.
1
2#include "rutil/Logger.hxx"
3
4#include "KurentoManager.hxx"
7
8#include <websocketpp/config/asio_no_tls_client.hpp>
9#include <websocketpp/client.hpp>
10
11typedef websocketpp::client<websocketpp::config::asio_client> client;
12
13using namespace kurento;
14
15#define RESIPROCATE_SUBSYSTEM kurento::KurentoSubsystem::KURENTOCLIENT
16
17KurentoManager::KurentoManager(std::chrono::milliseconds timeout, std::chrono::milliseconds retryInterval)
18 : mTimeout(timeout),
19 mRetryInterval(retryInterval)
20{
21 mWSClient.init_asio(&mAsio);
22}
23
28
29void
31{
32 mAsio.poll();
33}
34
37{
38 KurentoConnection::ptr kConnection = std::make_shared<KurentoConnection>(observer, uri, mWSClient, mTimeout, mRetryInterval);
39
40 // Note that connect here only requests a connection. No network messages are
41 // exchanged until the event loop starts running in the next line.
42 kConnection->onRetryRequired();
43
44 return kConnection;
45
46}
47
48
49/* ====================================================================
50
51 Copyright (c) 2021, Software Freedom Institute https://softwarefreedom.institute
52 Copyright (c) 2021, Daniel Pocock https://danielpocock.com
53 All rights reserved.
54
55 Redistribution and use in source and binary forms, with or without
56 modification, are permitted provided that the following conditions are
57 met:
58
59 1. Redistributions of source code must retain the above copyright
60 notice, this list of conditions and the following disclaimer.
61
62 2. Redistributions in binary form must reproduce the above copyright
63 notice, this list of conditions and the following disclaimer in the
64 documentation and/or other materials provided with the distribution.
65
66 3. Neither the name of Plantronics nor the names of its contributors
67 may be used to endorse or promote products derived from this
68 software without specific prior written permission.
69
70 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
71 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
72 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
73 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
74 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
75 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
76 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
77 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
78 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
79 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
80 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
81
82 ==================================================================== */
std::shared_ptr< KurentoConnection > ptr
KurentoManager(std::chrono::milliseconds timeout, std::chrono::milliseconds retryInterval)
KurentoConnection::ptr getKurentoConnection(const std::string &uri, KurentoConnectionObserver &observer)
This class is used in the logging subsystem to identify logging messages generated from the Kurento c...
websocketpp::client< websocketpp::config::asio_client > client
void list()
Definition userAdmin.cxx:66