19 #include <gflags/gflags.h> 28 using namespace folly;
40 std::cout <<
"received back: " << msg;
47 std::cout <<
"EOF received :(" << std::endl;
56 std::shared_ptr<AsyncTransportWrapper> sock)
override {
63 pipeline->addBack(EchoHandler());
73 client.
group(std::make_shared<folly::IOThreadPoolExecutor>(1));
85 pipeline->write(line +
"\r\n").get();
91 }
catch (
const std::exception& e) {
void read(Context *, std::string msg) override
DEFINE_int32(port, 8080,"echo server port")
fbstring exceptionStr(const std::exception &e)
void readEOF(Context *ctx) override
void BENCHFUN() getline(size_t iters, size_t arg)
folly::Future< Pipeline * > connect(const folly::SocketAddress &address, std::chrono::milliseconds timeout=std::chrono::milliseconds(0)) override
void readException(Context *ctx, exception_wrapper e) override
—— Concurrent Priority Queue Implementation ——
EchoPipeline::Ptr newPipeline(std::shared_ptr< AsyncTransportWrapper > sock) override
void init(int *argc, char ***argv, bool removeFlags)
int main(int argc, char **argv)
BaseClientBootstrap< Pipeline > * pipelineFactory(std::shared_ptr< PipelineFactory< Pipeline >> factory) noexcept
Pipeline< folly::IOBufQueue &, std::string > EchoPipeline
DEFINE_string(host,"::1","echo server address")
std::shared_ptr< Pipeline > Ptr
ClientBootstrap * group(std::shared_ptr< folly::IOThreadPoolExecutor > group)
int close(NetworkSocket s)