-
Notifications
You must be signed in to change notification settings - Fork 732
/
Copy pathsio_client.cpp
165 lines (132 loc) · 3.76 KB
/
sio_client.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
//
// sio_client.h
//
// Created by Melo Yao on 3/25/15.
//
#include "sio_client.h"
#include "internal/sio_client_impl.h"
using namespace websocketpp;
using std::stringstream;
namespace sio
{
client::client() : m_impl(new client_impl({})) {}
client::client(client_options const& options):
m_impl(new client_impl(options))
{
}
client::~client()
{
delete m_impl;
}
void client::set_open_listener(con_listener const& l)
{
m_impl->set_open_listener(l);
}
void client::set_fail_listener(con_listener const& l)
{
m_impl->set_fail_listener(l);
}
void client::set_close_listener(close_listener const& l)
{
m_impl->set_close_listener(l);
}
void client::set_socket_open_listener(socket_listener const& l)
{
m_impl->set_socket_open_listener(l);
}
void client::set_reconnect_listener(reconnect_listener const& l)
{
m_impl->set_reconnect_listener(l);
}
void client::set_reconnecting_listener(con_listener const& l)
{
m_impl->set_reconnecting_listener(l);
}
void client::set_socket_close_listener(socket_listener const& l)
{
m_impl->set_socket_close_listener(l);
}
void client::clear_con_listeners()
{
m_impl->clear_con_listeners();
}
void client::clear_socket_listeners()
{
m_impl->clear_socket_listeners();
}
void client::set_proxy_basic_auth(const std::string& uri, const std::string& username, const std::string& password)
{
m_impl->set_proxy_basic_auth(uri, username, password);
}
void client::connect(const std::string& uri)
{
m_impl->connect(uri, {}, {}, {});
}
void client::connect(const std::string& uri, const message::ptr& auth)
{
m_impl->connect(uri, {}, {}, auth);
}
void client::connect(const std::string& uri, const std::map<string,string>& query)
{
m_impl->connect(uri, query, {}, {});
}
void client::connect(const std::string& uri, const std::map<string,string>& query, const message::ptr& auth)
{
m_impl->connect(uri, query, {}, auth);
}
void client::connect(const std::string& uri, const std::map<std::string,std::string>& query,
const std::map<std::string,std::string>& http_extra_headers)
{
m_impl->connect(uri, query, http_extra_headers, {});
}
void client::connect(const std::string& uri, const std::map<std::string,std::string>& query,
const std::map<std::string,std::string>& http_extra_headers, const message::ptr& auth)
{
m_impl->connect(uri, query, http_extra_headers, auth);
}
socket::ptr const& client::socket(const std::string& nsp)
{
return m_impl->socket(nsp);
}
// Closes the connection
void client::close()
{
m_impl->close();
}
void client::sync_close()
{
m_impl->sync_close();
}
bool client::opened() const
{
return m_impl->opened();
}
std::string const& client::get_sessionid() const
{
return m_impl->get_sessionid();
}
void client::set_reconnect_attempts(int attempts)
{
m_impl->set_reconnect_attempts(attempts);
}
void client::set_reconnect_delay(unsigned millis)
{
m_impl->set_reconnect_delay(millis);
}
void client::set_reconnect_delay_max(unsigned millis)
{
m_impl->set_reconnect_delay_max(millis);
}
void client::set_logs_default()
{
m_impl->set_logs_default();
}
void client::set_logs_quiet()
{
m_impl->set_logs_quiet();
}
void client::set_logs_verbose()
{
m_impl->set_logs_verbose();
}
}