@@ -148,46 +148,46 @@ namespace Plugin {
148
148
return it->second ->getIdentifier ();
149
149
}
150
150
}
151
- websocketpp::lib::error_code ec ;
151
+ websocketpp::lib::error_code errorCode ;
152
152
153
- WebSocketAsioClient::connection_ptr con = mEndPoint .get_connection (uri, ec );
153
+ WebSocketAsioClient::connection_ptr clientConnection = mEndPoint .get_connection (uri, errorCode );
154
154
std::cout << " NEW CONNECTION FOR " << uri << std::endl;
155
- if (ec )
155
+ if (errorCode )
156
156
{
157
- std::cout << " > Connect initialization error: " << ec .message () << std::endl;
157
+ std::cout << " Failed to initialize connection. error: " << errorCode .message () << std::endl;
158
158
return -1 ;
159
159
}
160
160
161
161
int newId = mNextIdentifier ++;
162
- ConnectionMetaData::sharedPtr metaDataReference = websocketpp::lib::make_shared<ConnectionMetaData>(newId, con ->get_handle (), uri);
162
+ ConnectionMetaData::sharedPtr metaDataReference = websocketpp::lib::make_shared<ConnectionMetaData>(newId, clientConnection ->get_handle (), uri);
163
163
mConnectionList [newId] = metaDataReference;
164
164
165
- con ->set_open_handler (websocketpp::lib::bind (
165
+ clientConnection ->set_open_handler (websocketpp::lib::bind (
166
166
&ConnectionMetaData::onOpen,
167
167
metaDataReference,
168
168
&mEndPoint ,
169
169
websocketpp::lib::placeholders::_1
170
170
));
171
- con ->set_fail_handler (websocketpp::lib::bind (
171
+ clientConnection ->set_fail_handler (websocketpp::lib::bind (
172
172
&ConnectionMetaData::onFail,
173
173
metaDataReference,
174
174
&mEndPoint ,
175
175
websocketpp::lib::placeholders::_1
176
176
));
177
- con ->set_close_handler (websocketpp::lib::bind (
177
+ clientConnection ->set_close_handler (websocketpp::lib::bind (
178
178
&ConnectionMetaData::onClose,
179
179
metaDataReference,
180
180
&mEndPoint ,
181
181
websocketpp::lib::placeholders::_1
182
182
));
183
- con ->set_message_handler (websocketpp::lib::bind (
183
+ clientConnection ->set_message_handler (websocketpp::lib::bind (
184
184
&ConnectionMetaData::onMessage,
185
185
metaDataReference,
186
186
websocketpp::lib::placeholders::_1,
187
187
websocketpp::lib::placeholders::_2
188
188
));
189
189
190
- mEndPoint .connect (con );
190
+ mEndPoint .connect (clientConnection );
191
191
if (wait)
192
192
{
193
193
metaDataReference->waitForEvent ();
0 commit comments