SNode.C
Loading...
Searching...
No Matches
httpclientclientcert.cpp File Reference
Include dependency graph for httpclientclientcert.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 31 of file httpclientclientcert.cpp.

31 {
32 core::SNodeC::init(argc, argv);
33
34 using Client = apps::http::STREAM::Client;
35 using SocketAddress = Client::SocketAddress;
36
37 const Client client = apps::http::STREAM::getClient();
38
39 client.connect([instanceName = client.getConfig().getInstanceName()](
40 const SocketAddress& socketAddress,
41 const core::socket::State& state) { // example.com:81 simulate connnect timeout
42 switch (state) {
43 case core::socket::State::OK:
44 VLOG(1) << instanceName << ": connected to '" << socketAddress.toString() << "'";
45 break;
46 case core::socket::State::DISABLED:
47 VLOG(1) << instanceName << ": disabled";
48 break;
49 case core::socket::State::ERROR:
50 LOG(ERROR) << instanceName << ": " << socketAddress.toString() << ": " << state.what();
51 break;
52 case core::socket::State::FATAL:
53 LOG(FATAL) << instanceName << ": " << socketAddress.toString() << ": " << state.what();
54 break;
55 }
56 });
57 return core::SNodeC::start();
58}
static void init(int argc, char *argv[])
Definition SNodeC.cpp:32
static int start(const utils::Timeval &timeOut={LONG_MAX, 0})
Definition SNodeC.cpp:38
web::http::legacy::NET::Client Client
Definition clients.h:63
SocketClient::SocketAddress SocketAddress