FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
http_client.hpp File Reference

Keep-alive HTTP/1.1 client over any ByteStream: one request in flight per connection plus a small FIFO, response bodies framed by Content-Length / chunked / connection-close, and a per-request reactor timer. More...

#include "fastmm/net/byte_stream.hpp"
#include "fastmm/net/http_message.hpp"
#include "fastmm/net/reactor.hpp"
#include "fastmm/net/recv_buffer.hpp"
#include "fastmm/net/wire_buffer.hpp"
#include <cstddef>
#include <cstdint>
#include <deque>
#include <functional>
#include <string>
#include <string_view>
#include <utility>

Go to the source code of this file.

Classes

struct  fastmm::net::HttpResponse
 
struct  fastmm::net::HttpClientConfig
 
struct  fastmm::net::HttpClientStats
 
class  fastmm::net::HttpClient< Stream >
 

Namespaces

namespace  fastmm
 
namespace  fastmm::net
 

Typedefs

using fastmm::net::HttpResponseCallback = std::function< void(const HttpResponse &)>
 
using fastmm::net::HttpTargetMaker = std::function< std::string()>
 Makes a request's target (path and query) when the request is written.
 

Enumerations

enum class  fastmm::net::HttpClientState : std::uint8_t { fastmm::net::Idle , fastmm::net::Connecting , fastmm::net::Ready , fastmm::net::Closed }
 

Detailed Description

Keep-alive HTTP/1.1 client over any ByteStream: one request in flight per connection plus a small FIFO, response bodies framed by Content-Length / chunked / connection-close, and a per-request reactor timer.

Callbacks run on the reactor thread; header and body views are valid only for the duration of the callback (they point into the receive buffer).

REST is the venue control path (exchangeInfo, listenKey, cancel-all fallback); order flow goes over the WebSocket API. Requests are therefore serialised into a std::string at enqueue time - simple and safe, not zero-allocation - or, for a target that must be made when the request goes on the wire (a signed query's timestamp), when it reaches the queue's head.