BinaryNinja::CoreWebsocketClient Class Reference

Public Member Functions

 CoreWebsocketClient (BNWebsocketClient *instance)
 
virtual ~CoreWebsocketClient ()
 
virtual bool Connect (const std::string &host, const std::unordered_map< std::string, std::string > &headers) override
 Virtual method for performing the connection, overridden by a subclass. More...
 
virtual bool Write (const std::vector< uint8_t > &data) override
 Write some data to the websocket. More...
 
virtual bool Disconnect () override
 Disconnect the websocket. More...
 
- Public Member Functions inherited from BinaryNinja::WebsocketClient
bool Connect (const std::string &host, const std::unordered_map< std::string, std::string > &headers, BNWebsocketClientOutputCallbacks *callbacks)
 Connect to a given url, asynchronously. More...
 
virtual bool Write (const std::vector< uint8_t > &data)=0
 Write some data to the websocket. More...
 
virtual bool Disconnect ()=0
 Disconnect the websocket. More...
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNWebsocketClient, BNNewWebsocketClientReference, BNFreeWebsocketClient >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNWebsocketClient * GetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 

Additional Inherited Members

- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNWebsocketClient, BNNewWebsocketClientReference, BNFreeWebsocketClient >
static BNWebsocketClient * GetObject (CoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNWebsocketClient, BNNewWebsocketClientReference, BNFreeWebsocketClient >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNWebsocketClient * m_object
 
- Protected Member Functions inherited from BinaryNinja::WebsocketClient
 WebsocketClient (WebsocketProvider *provider)
 
 WebsocketClient (BNWebsocketClient *instance)
 
bool ReadData (uint8_t *data, uint64_t len)
 
virtual void DestroyClient ()
 Cleanup any resources created by the client. More...
 
virtual bool Connect (const std::string &host, const std::unordered_map< std::string, std::string > &headers)=0
 Virtual method for performing the connection, overridden by a subclass. More...
 
- Static Protected Member Functions inherited from BinaryNinja::WebsocketClient
static void DestroyClientCallback (void *ctxt)
 
static bool ConnectCallback (void *ctxt, const char *host, uint64_t headerCount, const char *const *headerKeys, const char *const *headerValues)
 
static bool WriteCallback (const uint8_t *data, uint64_t len, void *ctxt)
 
static bool DisconnectCallback (void *ctxt)
 
static void ErrorCallback (const char *msg, void *ctxt)
 

Constructor & Destructor Documentation

◆ CoreWebsocketClient()

CoreWebsocketClient::CoreWebsocketClient ( BNWebsocketClient *  instance)

◆ ~CoreWebsocketClient()

virtual BinaryNinja::CoreWebsocketClient::~CoreWebsocketClient ( )
inlinevirtual

Member Function Documentation

◆ Connect()

bool CoreWebsocketClient::Connect ( const std::string &  host,
const std::unordered_map< std::string, std::string > &  headers 
)
overridevirtual

Virtual method for performing the connection, overridden by a subclass.

Parameters
hostFull url with scheme, domain, optionally port, and path
headersHTTP header keys and values
Returns
True if the connection has started, but not necessarily if it succeeded

Implements BinaryNinja::WebsocketClient.

◆ Disconnect()

bool CoreWebsocketClient::Disconnect ( )
overridevirtual

Disconnect the websocket.

Returns
True if successful

Implements BinaryNinja::WebsocketClient.

◆ Write()

bool CoreWebsocketClient::Write ( const std::vector< uint8_t > &  data)
overridevirtual

Write some data to the websocket.

Parameters
dataData to write
Returns
True if successful

Implements BinaryNinja::WebsocketClient.


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