[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/CREDITSCOM/node/master/samples/api-client/api-client.cpp [Back]  [Original]

#include 

#include 
#include 
#include 

#include 

struct Host
{
    std::string ip;
    uint16_t port{ 0 };
};

bool test(const Host& host)
{
    using namespace apache::thrift;
    using namespace apache::thrift::protocol;
    using namespace apache::thrift::transport;

    auto ptr = new TSocket(host.ip, host.port);
    ptr->setConnTimeout(10000);
    stdcxx::shared_ptr socket(ptr);
    stdcxx::shared_ptr transport(new TBufferedTransport(socket));
    stdcxx::shared_ptr protocol(new TBinaryProtocol(transport));
    api::APIClient client(protocol);

    bool ret = false;

    try {
        std::cout 

Web Proxy Viewer  |  New URL  |  Original Page