proxygen
EchoHandler Class Reference
Inheritance diagram for EchoHandler:
wangle::HandlerAdapter< std::string > wangle::HandlerAdapter< std::string > wangle::HandlerAdapter< std::string > wangle::HandlerAdapter< std::string > wangle::Handler< std::string, std::string, std::string, std::string > wangle::Handler< std::string, std::string, std::string, std::string > wangle::Handler< std::string, std::string, std::string, std::string > wangle::Handler< std::string, std::string, std::string, std::string > wangle::HandlerBase< HandlerContext< std::string, std::string > > wangle::HandlerBase< HandlerContext< std::string, std::string > > wangle::HandlerBase< HandlerContext< std::string, std::string > > wangle::HandlerBase< HandlerContext< std::string, std::string > >

Public Member Functions

void read (Context *, std::string msg) override
 
void readException (Context *ctx, exception_wrapper e) override
 
void readEOF (Context *ctx) override
 
void read (Context *ctx, std::string msg) override
 
- Public Member Functions inherited from wangle::HandlerAdapter< std::string >
void read (Context *ctx, std::stringmsg) override
 
folly::Future< folly::Unitwrite (Context *ctx, std::stringmsg) override
 
- Public Member Functions inherited from wangle::Handler< std::string, std::string, std::string, std::string >
 ~Handler () override=default
 
virtual void transportActive (Context *ctx)
 
virtual void transportInactive (Context *ctx)
 
virtual folly::Future< folly::UnitwriteException (Context *ctx, folly::exception_wrapper e)
 
virtual folly::Future< folly::Unitclose (Context *ctx)
 
- Public Member Functions inherited from wangle::HandlerBase< HandlerContext< std::string, std::string > >
virtual ~HandlerBase ()=default
 
virtual void attachPipeline (HandlerContext< std::string, std::string > *)
 
virtual void detachPipeline (HandlerContext< std::string, std::string > *)
 
HandlerContext< std::string, std::string > * getContext ()
 

Additional Inherited Members

- Public Types inherited from wangle::HandlerAdapter< std::string >
typedef Handler< std::string, std::string, std::string, std::string >::Context Context
 
- Public Types inherited from wangle::Handler< std::string, std::string, std::string, std::string >
typedef std::string rin
 
typedef std::string rout
 
typedef std::string win
 
typedef std::string wout
 
typedef HandlerContext< std::string, std::stringContext
 
- Static Public Attributes inherited from wangle::Handler< std::string, std::string, std::string, std::string >
static const HandlerDir dir
 

Detailed Description

Definition at line 37 of file EchoClient.cpp.

Member Function Documentation

void EchoHandler::read ( Context ctx,
std::string  msg 
)
inlineoverridevirtual

Implements wangle::Handler< std::string, std::string, std::string, std::string >.

Definition at line 36 of file EchoServer.cpp.

References fizz::detail::write().

36  {
37  std::cout << "handling " << msg << std::endl;
38  write(ctx, msg + "\r\n");
39  }
folly::Future< folly::Unit > write(Context *ctx, std::stringmsg) override
Definition: Handler.h:167
void EchoHandler::read ( Context ,
std::string  msg 
)
inlineoverridevirtual

Implements wangle::Handler< std::string, std::string, std::string, std::string >.

Definition at line 39 of file EchoClient.cpp.

39  {
40  std::cout << "received back: " << msg;
41  }
void EchoHandler::readEOF ( Context ctx)
inlineoverridevirtual

Reimplemented from wangle::Handler< std::string, std::string, std::string, std::string >.

Definition at line 46 of file EchoClient.cpp.

References folly::netops::close().

46  {
47  std::cout << "EOF received :(" << std::endl;
48  close(ctx);
49  }
virtual folly::Future< folly::Unit > close(Context *ctx)
Definition: Handler.h:79
void EchoHandler::readException ( Context ctx,
exception_wrapper  e 
)
inlineoverridevirtual

Reimplemented from wangle::Handler< std::string, std::string, std::string, std::string >.

Definition at line 42 of file EchoClient.cpp.

References folly::netops::close(), and folly::exceptionStr().

42  {
43  std::cout << exceptionStr(e) << std::endl;
44  close(ctx);
45  }
fbstring exceptionStr(const std::exception &e)
virtual folly::Future< folly::Unit > close(Context *ctx)
Definition: Handler.h:79

The documentation for this class was generated from the following files: