Files
xahaud/src/ripple/http/api/Handler.h
2013-09-22 13:27:24 -07:00

49 lines
1.2 KiB
C++

//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================
#ifndef RIPPLE_HTTP_HANDLER_H_INCLUDED
#define RIPPLE_HTTP_HANDLER_H_INCLUDED
namespace ripple {
using namespace beast;
namespace HTTP {
class Server;
class Session;
/** Processes all sessions.
Thread safety:
Must be safe to call concurrently from any number of foreign threads.
*/
struct Handler
{
/** Called when the connection is accepted and we know remoteAddress. */
virtual void onAccept (Session& session) = 0;
/** Called repeatedly as new HTTP headers are received.
Guaranteed to be called at least once.
*/
virtual void onHeaders (Session& session) = 0;
/** Called when we have the full Content-Body. */
virtual void onRequest (Session& session) = 0;
/** Called when the session ends.
Guaranteed to be called once.
@param errorCode Non zero for a failed connection.
*/
virtual void onClose (Session& session, int errorCode) = 0;
/** Called when the server has finished its stop. */
virtual void onStopped (Server& server) = 0;
};
}
}
#endif