9#pragma warning(disable : 4251)
28 [[nodiscard]]
bool isStarted()
const {
return started; }
44 bool stopping =
false;
46 void onNewClient(AsyncSocketAccept::Result& result);
unsigned short uint16_t
Platform independent (2) bytes unsigned int.
Definition PrimitiveTypes.h:37
Definition AsyncStreams.h:51
Holds a Span of AsyncBufferView (allocated by user) holding available memory for the streams.
Definition AsyncStreams.h:139
Asynchronous I/O (files, sockets, timers, processes, fs events, threads wake-up) (see Async) AsyncEve...
Definition Async.h:1198
Starts a socket accept operation, obtaining a new socket from a listening socket.
Definition Async.h:469
Definition HttpAsyncServer.h:12
Result start(AsyncEventLoop &loop, StringSpan address, uint16_t port, HttpServer::Memory &memory)
Starts the http server on the given AsyncEventLoop, address and port.
bool isStarted() const
Returns true if the server has been started.
Definition HttpAsyncServer.h:28
void setupStreamsMemory(Span< AsyncReadableStream::Request > readQueue, Span< AsyncWritableStream::Request > writeQueue, Span< AsyncBufferView > buffers)
Enables using AsyncStreams instead of raw Async Send and Receive.
HttpServer httpServer
The underlying http server.
Definition HttpAsyncServer.h:35
Result stopAsync()
Stops http server asynchronously pushing cancel and close requests for next SC::AsyncEventLoop::runOn...
Result stopSync()
Stops http server synchronously waiting for SC::AsyncEventLoop::runNoWait to cancel or close all requ...
Definition HttpServer.h:108
Definition HttpServer.h:155
Async Http server.
Definition HttpServer.h:153
An ascii string used as boolean result. SC_TRY macro forwards errors to caller.
Definition Result.h:12
Low-level OS socket handle.
Definition Socket.h:153
View over a contiguous sequence of items (pointer + size in elements).
Definition Span.h:29
An read-only view over a string (to avoid including Strings library when parsing is not needed).
Definition StringSpan.h:37