286 {
288 "legacy",
290 VLOG(1) << "OnConnect";
291
292 VLOG(1) << "\tServer: " << socketConnection->getRemoteAddress().toString();
293 VLOG(1) << "\tClient: " << socketConnection->getLocalAddress().toString();
294 },
295 [](SocketConnection* socketConnection) {
296 VLOG(1) << "OnConnected";
297
298 socketConnection->sendToPeer("GET /index.html HTTP/1.1\r\nConnection: close\r\n\r\n");
299 },
301 VLOG(1) << "OnDisconnect";
302
303 VLOG(1) << "\tServer: " << socketConnection->getRemoteAddress().toString();
304 VLOG(1) << "\tClient: " << socketConnection->getLocalAddress().toString();
305 });
306
308
309 remoteAddress.init();
310
311 VLOG(1) << "###############': " << remoteAddress.getCanonName();
312 VLOG(1) << "###############': " << remoteAddress.toString();
313
314 legacyClient.connect(remoteAddress,
315 [instanceName = legacyClient.getConfig().getInstanceName()](
318 switch (state) {
319 case core::socket::State::OK:
320 VLOG(1) << instanceName << ": connected to '" << socketAddress.toString() << "'";
321 break;
322 case core::socket::State::DISABLED:
323 VLOG(1) << instanceName << ": disabled";
324 break;
325 case core::socket::State::ERROR:
326 LOG(ERROR) << instanceName << ": " << socketAddress.toString() << ": " << state.what();
327 break;
328 case core::socket::State::FATAL:
329 LOG(FATAL) << instanceName << ": " << socketAddress.toString() << ": " << state.what();
330 break;
331 }
332 });
333
334 return legacyClient;
335 }
Client::SocketConnection SocketConnection
SocketClient::SocketConnection SocketConnection
SocketClient::SocketAddress SocketAddress