mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-28 23:15:52 +00:00
Isolate WebSocket 0.2-specific code.
* Hide implementation details of the WebSocket server from clients. * Extract a generic traits class.
This commit is contained in:
@@ -17,34 +17,33 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_APP_WEBSOCKET_WSDOOR_H_INCLUDED
|
||||
#define RIPPLE_APP_WEBSOCKET_WSDOOR_H_INCLUDED
|
||||
#ifndef RIPPLED_RIPPLE_WEBSOCKET_MAKESERVER_H
|
||||
#define RIPPLED_RIPPLE_WEBSOCKET_MAKESERVER_H
|
||||
|
||||
#include <ripple/app/main/CollectorManager.h>
|
||||
#include <ripple/net/InfoSub.h>
|
||||
#include <ripple/resource/Manager.h>
|
||||
#include <ripple/server/Port.h>
|
||||
#include <beast/threads/Stoppable.h>
|
||||
|
||||
namespace beast { class Stoppable; }
|
||||
|
||||
namespace ripple {
|
||||
|
||||
/** Handles accepting incoming WebSocket connections. */
|
||||
class WSDoor : public beast::Stoppable
|
||||
namespace Resource { class Manager; }
|
||||
|
||||
namespace websocket {
|
||||
|
||||
struct ServerDescription
|
||||
{
|
||||
protected:
|
||||
explicit WSDoor (Stoppable& parent);
|
||||
|
||||
public:
|
||||
virtual ~WSDoor() = default;
|
||||
|
||||
// VFALCO TODO Add this member function to prevent races on shutdown
|
||||
//virtual void close() = 0;
|
||||
HTTP::Port port;
|
||||
Resource::Manager& resourceManager;
|
||||
InfoSub::Source& source;
|
||||
beast::Journal& journal;
|
||||
CollectorManager& collectorManager;
|
||||
};
|
||||
|
||||
std::unique_ptr<WSDoor>
|
||||
make_WSDoor (HTTP::Port const& port, Resource::Manager& resourceManager,
|
||||
InfoSub::Source& source, CollectorManager& cm);
|
||||
std::unique_ptr<beast::Stoppable> makeServer (ServerDescription const&);
|
||||
|
||||
}
|
||||
} // websocket
|
||||
} // ripple
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user