Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::HttpAsyncServer Struct Reference

Public Member Functions

Result start (AsyncEventLoop &loop, StringSpan address, uint16_t port, HttpServer::Memory &memory)
 Starts the http server on the given AsyncEventLoop, address and port.
 
Result stopAsync ()
 Stops http server asynchronously pushing cancel and close requests for next SC::AsyncEventLoop::runOnce.
 
Result stopSync ()
 Stops http server synchronously waiting for SC::AsyncEventLoop::runNoWait to cancel or close all requests.
 
bool isStarted () const
 Returns true if the server has been started.
 
void setupStreamsMemory (Span< AsyncReadableStream::Request > readQueue, Span< AsyncWritableStream::Request > writeQueue, Span< AsyncBufferView > buffers)
 Enables using AsyncStreams instead of raw Async Send and Receive.
 

Public Attributes

HttpServer httpServer
 The underlying http server.
 

Member Function Documentation

◆ isStarted()

bool SC::HttpAsyncServer::isStarted ( ) const
inlinenodiscard

Returns true if the server has been started.

◆ setupStreamsMemory()

void SC::HttpAsyncServer::setupStreamsMemory ( Span< AsyncReadableStream::Request > readQueue,
Span< AsyncWritableStream::Request > writeQueue,
Span< AsyncBufferView > buffers )

Enables using AsyncStreams instead of raw Async Send and Receive.

◆ start()

Result SC::HttpAsyncServer::start ( AsyncEventLoop & loop,
StringSpan address,
uint16_t port,
HttpServer::Memory & memory )

Starts the http server on the given AsyncEventLoop, address and port.

Parameters
loopThe event loop to be used, where to add the listening socket
addressThe address of local interface where to listen to
portThe local port where to start listening to
memoryMemory buffers to be used by the http server
Returns
Valid Result if http listening has been started successfully

◆ stopAsync()

Result SC::HttpAsyncServer::stopAsync ( )

Stops http server asynchronously pushing cancel and close requests for next SC::AsyncEventLoop::runOnce.

◆ stopSync()

Result SC::HttpAsyncServer::stopSync ( )

Stops http server synchronously waiting for SC::AsyncEventLoop::runNoWait to cancel or close all requests.

Member Data Documentation

◆ httpServer

HttpServer SC::HttpAsyncServer::httpServer

The underlying http server.


The documentation for this struct was generated from the following file: