![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
#include <string>
#include <stdint.h>
#include <boost/thread.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/function.hpp>
Go to the source code of this file.
Classes | |
class | HTTPRequest |
class | HTTPClosure |
class | HTTPEvent |
Typedefs | |
typedef boost::function< void(HTTPRequest *req, const std::string &)> | HTTPRequestHandler |
Functions | |
bool | InitHTTPServer () |
bool | StartHTTPServer () |
void | InterruptHTTPServer () |
void | StopHTTPServer () |
void | RegisterHTTPHandler (const std::string &prefix, bool exactMatch, const HTTPRequestHandler &handler) |
void | UnregisterHTTPHandler (const std::string &prefix, bool exactMatch) |
struct event_base * | EventBase () |
Variables | |
static const int | DEFAULT_HTTP_THREADS =4 |
static const int | DEFAULT_HTTP_WORKQUEUE =16 |
static const int | DEFAULT_HTTP_SERVER_TIMEOUT =30 |
typedef boost::function<void(HTTPRequest* req, const std::string &)> HTTPRequestHandler |
Handler for requests to a certain HTTP path
Definition at line 38 of file httpserver.h.
struct event_base* EventBase | ( | ) |
Return evhttp event base. This can be used by submodules to queue timers or custom events.
Definition at line 523 of file httpserver.cpp.
Referenced by StartHTTPRPC().
bool InitHTTPServer | ( | ) |
Initialize HTTP server. Call this before RegisterHTTPHandler or EventBase().
Definition at line 384 of file httpserver.cpp.
Referenced by AppInitServers().
void InterruptHTTPServer | ( | ) |
Interrupt HTTP server threads
Definition at line 465 of file httpserver.cpp.
Referenced by Interrupt().
void RegisterHTTPHandler | ( | const std::string & | prefix, |
bool | exactMatch, | ||
const HTTPRequestHandler & | handler | ||
) |
Register handler for prefix. If multiple handlers match a prefix, the first-registered one will be invoked.
Definition at line 665 of file httpserver.cpp.
Referenced by StartHTTPRPC(), and StartREST().
bool StartHTTPServer | ( | ) |
Start HTTP server. This is separate from InitHTTPServer to give users race-condition-free time to register their handlers between InitHTTPServer and StartHTTPServer.
Definition at line 453 of file httpserver.cpp.
Referenced by AppInitServers().
void StopHTTPServer | ( | ) |
void UnregisterHTTPHandler | ( | const std::string & | prefix, |
bool | exactMatch | ||
) |
Unregister handler for prefix
Definition at line 671 of file httpserver.cpp.
Referenced by StopHTTPRPC(), and StopREST().
|
static |
Definition at line 16 of file httpserver.h.
Referenced by HelpMessage(), and InitHTTPServer().
|
static |
Definition at line 14 of file httpserver.h.
Referenced by HelpMessage(), and StartHTTPServer().
|
static |
Definition at line 15 of file httpserver.h.
Referenced by HelpMessage(), and InitHTTPServer().