mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Update dependencies
This commit is contained in:
7
vendor/github.com/apache/thrift/tutorial/cpp/CppClient.cpp
generated
vendored
7
vendor/github.com/apache/thrift/tutorial/cpp/CppClient.cpp
generated
vendored
@@ -22,6 +22,7 @@
|
||||
#include <thrift/protocol/TBinaryProtocol.h>
|
||||
#include <thrift/transport/TSocket.h>
|
||||
#include <thrift/transport/TTransportUtils.h>
|
||||
#include <thrift/stdcxx.h>
|
||||
|
||||
#include "../gen-cpp/Calculator.h"
|
||||
|
||||
@@ -34,9 +35,9 @@ using namespace tutorial;
|
||||
using namespace shared;
|
||||
|
||||
int main() {
|
||||
boost::shared_ptr<TTransport> socket(new TSocket("localhost", 9090));
|
||||
boost::shared_ptr<TTransport> transport(new TBufferedTransport(socket));
|
||||
boost::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
|
||||
stdcxx::shared_ptr<TTransport> socket(new TSocket("localhost", 9090));
|
||||
stdcxx::shared_ptr<TTransport> transport(new TBufferedTransport(socket));
|
||||
stdcxx::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
|
||||
CalculatorClient client(protocol);
|
||||
|
||||
try {
|
||||
|
||||
41
vendor/github.com/apache/thrift/tutorial/cpp/CppServer.cpp
generated
vendored
41
vendor/github.com/apache/thrift/tutorial/cpp/CppServer.cpp
generated
vendored
@@ -27,8 +27,7 @@
|
||||
#include <thrift/transport/TSocket.h>
|
||||
#include <thrift/transport/TTransportUtils.h>
|
||||
#include <thrift/TToString.h>
|
||||
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <thrift/stdcxx.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
@@ -118,7 +117,7 @@ class CalculatorCloneFactory : virtual public CalculatorIfFactory {
|
||||
virtual ~CalculatorCloneFactory() {}
|
||||
virtual CalculatorIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo)
|
||||
{
|
||||
boost::shared_ptr<TSocket> sock = boost::dynamic_pointer_cast<TSocket>(connInfo.transport);
|
||||
stdcxx::shared_ptr<TSocket> sock = stdcxx::dynamic_pointer_cast<TSocket>(connInfo.transport);
|
||||
cout << "Incoming connection\n";
|
||||
cout << "\tSocketInfo: " << sock->getSocketInfo() << "\n";
|
||||
cout << "\tPeerHost: " << sock->getPeerHost() << "\n";
|
||||
@@ -133,18 +132,18 @@ class CalculatorCloneFactory : virtual public CalculatorIfFactory {
|
||||
|
||||
int main() {
|
||||
TThreadedServer server(
|
||||
boost::make_shared<CalculatorProcessorFactory>(boost::make_shared<CalculatorCloneFactory>()),
|
||||
boost::make_shared<TServerSocket>(9090), //port
|
||||
boost::make_shared<TBufferedTransportFactory>(),
|
||||
boost::make_shared<TBinaryProtocolFactory>());
|
||||
stdcxx::make_shared<CalculatorProcessorFactory>(stdcxx::make_shared<CalculatorCloneFactory>()),
|
||||
stdcxx::make_shared<TServerSocket>(9090), //port
|
||||
stdcxx::make_shared<TBufferedTransportFactory>(),
|
||||
stdcxx::make_shared<TBinaryProtocolFactory>());
|
||||
|
||||
/*
|
||||
// if you don't need per-connection state, do the following instead
|
||||
TThreadedServer server(
|
||||
boost::make_shared<CalculatorProcessor>(boost::make_shared<CalculatorHandler>()),
|
||||
boost::make_shared<TServerSocket>(9090), //port
|
||||
boost::make_shared<TBufferedTransportFactory>(),
|
||||
boost::make_shared<TBinaryProtocolFactory>());
|
||||
stdcxx::make_shared<CalculatorProcessor>(stdcxx::make_shared<CalculatorHandler>()),
|
||||
stdcxx::make_shared<TServerSocket>(9090), //port
|
||||
stdcxx::make_shared<TBufferedTransportFactory>(),
|
||||
stdcxx::make_shared<TBinaryProtocolFactory>());
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -152,25 +151,25 @@ int main() {
|
||||
|
||||
// This server only allows one connection at a time, but spawns no threads
|
||||
TSimpleServer server(
|
||||
boost::make_shared<CalculatorProcessor>(boost::make_shared<CalculatorHandler>()),
|
||||
boost::make_shared<TServerSocket>(9090),
|
||||
boost::make_shared<TBufferedTransportFactory>(),
|
||||
boost::make_shared<TBinaryProtocolFactory>());
|
||||
stdcxx::make_shared<CalculatorProcessor>(stdcxx::make_shared<CalculatorHandler>()),
|
||||
stdcxx::make_shared<TServerSocket>(9090),
|
||||
stdcxx::make_shared<TBufferedTransportFactory>(),
|
||||
stdcxx::make_shared<TBinaryProtocolFactory>());
|
||||
|
||||
const int workerCount = 4;
|
||||
|
||||
boost::shared_ptr<ThreadManager> threadManager =
|
||||
stdcxx::shared_ptr<ThreadManager> threadManager =
|
||||
ThreadManager::newSimpleThreadManager(workerCount);
|
||||
threadManager->threadFactory(
|
||||
boost::make_shared<PlatformThreadFactory>());
|
||||
stdcxx::make_shared<PlatformThreadFactory>());
|
||||
threadManager->start();
|
||||
|
||||
// This server allows "workerCount" connection at a time, and reuses threads
|
||||
TThreadPoolServer server(
|
||||
boost::make_shared<CalculatorProcessorFactory>(boost::make_shared<CalculatorCloneFactory>()),
|
||||
boost::make_shared<TServerSocket>(9090),
|
||||
boost::make_shared<TBufferedTransportFactory>(),
|
||||
boost::make_shared<TBinaryProtocolFactory>(),
|
||||
stdcxx::make_shared<CalculatorProcessorFactory>(stdcxx::make_shared<CalculatorCloneFactory>()),
|
||||
stdcxx::make_shared<TServerSocket>(9090),
|
||||
stdcxx::make_shared<TBufferedTransportFactory>(),
|
||||
stdcxx::make_shared<TBinaryProtocolFactory>(),
|
||||
threadManager);
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user