HTTPRemoteClient

A connected HTTP client, holding its socket plus the receive and send buffers.

Synopsis

Declared in <httpserver.h>

class HTTPRemoteClient;

Member Functions

NameDescription
HTTPRemoteClient [constructor]Constructors
operator= [deleted]Deleted copy assignment; clients are only used through shared pointers.
GetOrigin Returns the cached origin string of the connected peer.
GetPeer Returns the address of the connected peer.
GetRecvBuffer Used for tests. @{ Read the client's receive buffer.
GetRequest Access the request currently being parsed.
GetSock Returns the client's underlying socket.
MaybeDisconnect Flag the client for disconnection if it is idle past the timeout or a global disconnect is requested.
MaybeSendBytesFromBuffer Push data (if there is any) from client's m_send_buffer to the connected socket.
ReadyToSend Returns whether the client has response data ready to send.
Receive Read available bytes from the socket into the receive buffer.
Send Queue a response to be written to the client's socket.

Static Member Functions

NameDescription
TryReadRequest Try to read an HTTPRequest from a client's receive buffer. Only complete requests are returned, incomplete requests are left in the buffer to wait for more data. Some read errors will mark this client for disconnection.

Protected Member Functions

NameDescription
MutateRecvBuffer Used for tests.