Summary:
This code is only used in a test so far.
Basically it looks like Pipeline has some dependency issues - any addBack() pipelines have to be deleted *after* the main pipeline is destroyed. Ideally if the pipeline is already closed, the destruction order wouldn't matter. There is currently no removeBack() call either. This is a quick fix for the test to just delete stuff in the right order, we can discuss a better solution when @jsedgwick returns
Test Plan: fbconfig --sanitize=address --with-project-version=clang:3.5 --clang folly/wangle/service && fbmake runtests
Reviewed By: hans@fb.com
Subscribers: trunkagent, doug, fugalh, folly-diffs@, yfeldblum, jsedgwick
FB internal diff:
D1903200
Tasks:
6415578
Signature: t1:
1903200:
1426528298:
e109dcc0ec586a505a26cd95a6f20434d22cbd37
}
void notifyPendingShutdown() {}
void closeWhenIdle() {}
}
void notifyPendingShutdown() {}
void closeWhenIdle() {}
- void dropConnection() {}
+ void dropConnection() {
+ delete this;
+ }
void dumpConnectionState(uint8_t loglevel) {}
private:
PipelinePtr pipeline_;
void dumpConnectionState(uint8_t loglevel) {}
private:
PipelinePtr pipeline_;
server.bind(port);
// client
server.bind(port);
// client
- ClientBootstrap<Pipeline> client;
+ auto client = std::make_shared<ClientBootstrap<Pipeline>>();
ClientServiceFactory<Pipeline, std::string, std::string> serviceFactory;
ClientServiceFactory<Pipeline, std::string, std::string> serviceFactory;
- client.pipelineFactory(
+ client->pipelineFactory(
std::make_shared<ClientPipelineFactory<std::string, std::string>>());
SocketAddress addr("127.0.0.1", port);
std::make_shared<ClientPipelineFactory<std::string, std::string>>());
SocketAddress addr("127.0.0.1", port);
- client.connect(addr);
- auto service = serviceFactory(&client).value();
+ client->connect(addr);
+ auto service = std::shared_ptr<Service<std::string, std::string>>(
+ serviceFactory(client.get()).value());
auto rep = (*service)("test");
rep.then([&](std::string value) {
auto rep = (*service)("test");
rep.then([&](std::string value) {
});
EventBaseManager::get()->getEventBase()->loopForever();
server.stop();
});
EventBaseManager::get()->getEventBase()->loopForever();
server.stop();
}
class AppendFilter : public Filter<std::string, std::string> {
}
class AppendFilter : public Filter<std::string, std::string> {