typedef ChannelPipeline<IOBufQueue&, std::unique_ptr<IOBuf>> Pipeline;
-class TestServer : public ServerBootstrap<Pipeline> {
- Pipeline* newPipeline(std::shared_ptr<AsyncSocket>) {
- return nullptr;
- }
-};
+typedef ServerBootstrap<Pipeline> TestServer;
+typedef ClientBootstrap<Pipeline> TestClient;
-class TestClient : public ClientBootstrap<Pipeline> {
+class TestClientPipelineFactory : public PipelineFactory<Pipeline> {
+ public:
Pipeline* newPipeline(std::shared_ptr<AsyncSocket> sock) {
CHECK(sock->good());
server.getSockets()[0]->getAddress(&address);
TestClient client;
+ client.pipelineFactory(std::make_shared<TestClientPipelineFactory>());
client.connect(address);
base->loop();
server.stop();
server.getSockets()[0]->getAddress(&address);
TestClient client;
+ client.pipelineFactory(std::make_shared<TestClientPipelineFactory>());
+
client.connect(address);
TestClient client2;
+ client2.pipelineFactory(std::make_shared<TestClientPipelineFactory>());
client2.connect(address);
base->loop();
boost::barrier barrier(2);
auto thread = std::thread([&](){
TestClient client;
+ client.pipelineFactory(std::make_shared<TestClientPipelineFactory>());
client.connect(address);
EventBaseManager::get()->getEventBase()->loop();
barrier.wait();
server.getSockets()[0]->getAddress(&address);
TestClient client;
+ client.pipelineFactory(std::make_shared<TestClientPipelineFactory>());
+
client.connect(address);
EventBaseManager::get()->getEventBase()->loop();
server.getSockets()[0]->getAddress(&address);
TestClient client;
+ client.pipelineFactory(std::make_shared<TestClientPipelineFactory>());
client.connect(address);
TestClient client2;
+ client2.pipelineFactory(std::make_shared<TestClientPipelineFactory>());
client2.connect(address);
TestClient client3;
+ client3.pipelineFactory(std::make_shared<TestClientPipelineFactory>());
client3.connect(address);
TestClient client4;
+ client4.pipelineFactory(std::make_shared<TestClientPipelineFactory>());
client4.connect(address);
TestClient client5;
+ client5.pipelineFactory(std::make_shared<TestClientPipelineFactory>());
client5.connect(address);
EventBaseManager::get()->getEventBase()->loop();