CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
cmlabs::HTTPClientProtocol Class Reference

Client-side HTTP protocol handler (mirror of HTTPProtocol for outgoing requests). More...

#include <NetworkProtocols.h>

Inheritance diagram for cmlabs::HTTPClientProtocol:
[legend]
Collaboration diagram for cmlabs::HTTPClientProtocol:
[legend]

Public Member Functions

 HTTPClientProtocol ()
Public Member Functions inherited from cmlabs::NetworkProtocol
 NetworkProtocol ()

Static Public Member Functions

static bool CheckBufferForCompatibility (const char *buffer, uint32 length)
static bool InitialiseConversation (NetworkConnection *con)
 No initial exchange needed.
static bool SendHTTPReply (NetworkConnection *con, HTTPReply *reply)
 Serialise and send a reply.
static HTTPReplyReceiveHTTPReply (NetworkConnection *con, uint32 timeout)
 Read a full reply from the connection.
static bool SendHTTPRequest (NetworkConnection *con, HTTPRequest *req)
 Serialise and send a request.
static HTTPRequestReceiveHTTPRequest (NetworkConnection *con, uint32 timeout)
 Read a full request from the connection.
Static Public Member Functions inherited from cmlabs::NetworkProtocol
static bool CheckBufferForCompatibility (const char *buffer, uint32 length)
 Sniff whether buffer looks like this protocol.
static bool InitialiseConversation (NetworkConnection *con)
 Perform any protocol-specific initial exchange on a new connection.

Additional Inherited Members

Public Attributes inherited from cmlabs::NetworkProtocol
uint8 protocol
 PROTOCOL_* id of this handler.

Detailed Description

Client-side HTTP protocol handler (mirror of HTTPProtocol for outgoing requests).

Definition at line 849 of file NetworkProtocols.h.

Constructor & Destructor Documentation

◆ HTTPClientProtocol()

cmlabs::HTTPClientProtocol::HTTPClientProtocol ( )
inline

Definition at line 852 of file NetworkProtocols.h.

References cmlabs::NetworkProtocol::protocol, and PROTOCOL_HTTP_CLIENT.

Member Function Documentation

◆ CheckBufferForCompatibility()

bool cmlabs::HTTPClientProtocol::CheckBufferForCompatibility ( const char * buffer,
uint32 length )
static
Returns
true when buffer starts like an HTTP response (status line).

Definition at line 2277 of file NetworkProtocols.cpp.

◆ InitialiseConversation()

bool cmlabs::HTTPClientProtocol::InitialiseConversation ( NetworkConnection * con)
static

No initial exchange needed.

Parameters
conConnection.
Returns
true.

Definition at line 2281 of file NetworkProtocols.cpp.

◆ ReceiveHTTPReply()

HTTPReply * cmlabs::HTTPClientProtocol::ReceiveHTTPReply ( NetworkConnection * con,
uint32 timeout )
static

Read a full reply from the connection.

Parameters
conConnection.
timeoutMax wait in ms.
Returns
New reply owned by the caller, or NULL on timeout/parse failure. Blocking.

Definition at line 2289 of file NetworkProtocols.cpp.

◆ ReceiveHTTPRequest()

HTTPRequest * cmlabs::HTTPClientProtocol::ReceiveHTTPRequest ( NetworkConnection * con,
uint32 timeout )
static

Read a full request from the connection.

Parameters
conConnection.
timeoutMax wait in ms.
Returns
New request owned by the caller, or NULL. Blocking.

Definition at line 2297 of file NetworkProtocols.cpp.

◆ SendHTTPReply()

bool cmlabs::HTTPClientProtocol::SendHTTPReply ( NetworkConnection * con,
HTTPReply * reply )
static

Serialise and send a reply.

Parameters
conConnection.
replyReply (caller keeps ownership).
Returns
true if fully sent.

Definition at line 2285 of file NetworkProtocols.cpp.

◆ SendHTTPRequest()

bool cmlabs::HTTPClientProtocol::SendHTTPRequest ( NetworkConnection * con,
HTTPRequest * req )
static

Serialise and send a request.

Parameters
conConnection.
reqRequest (caller keeps ownership).
Returns
true if fully sent.

Definition at line 2293 of file NetworkProtocols.cpp.


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