BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface software
websocket_api.hpp
Go to the documentation of this file.
1 #pragma once
4 #include <fc/rpc/state.hpp>
5 
6 namespace fc { namespace rpc {
7 
9  {
10  public:
11  websocket_api_connection( const std::shared_ptr<fc::http::websocket_connection> &c,
12  uint32_t max_conversion_depth );
14 
15  virtual variant send_call(
16  api_id_type api_id,
17  string method_name,
18  variants args = variants() ) override;
19  virtual variant send_callback(
20  uint64_t callback_id,
21  variants args = variants() ) override;
22  virtual void send_notice(
23  uint64_t callback_id,
24  variants args = variants() ) override;
25 
26  protected:
27  response on_message( const std::string& message );
28  response on_request( const variant& message );
29  void on_response( const variant& message );
30 
31  std::shared_ptr<fc::http::websocket_connection> _connection;
33  };
34 
35 } } // namespace fc::rpc
virtual variant send_call(api_id_type api_id, string method_name, variants args=variants()) override
void on_response(const variant &message)
std::vector< variant > variants
Definition: variant.hpp:170
response on_message(const std::string &message)
virtual void send_notice(uint64_t callback_id, variants args=variants()) override
virtual variant send_callback(uint64_t callback_id, variants args=variants()) override
websocket_api_connection(const std::shared_ptr< fc::http::websocket_connection > &c, uint32_t max_conversion_depth)
response on_request(const variant &message)
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object&#39;s.
Definition: variant.hpp:198
uint32_t api_id_type
Definition: api.hpp:122
Definition: api.hpp:15
std::shared_ptr< fc::http::websocket_connection > _connection