|
arduino-audio-tools
|
RTSPServer - Multi-client Audio Streaming Server (task-based) More...
#include <RTSPServer.h>
Public Types | |
| using | streamer_t = RTSPAudioStreamerBase< Platform > |
Public Member Functions | |
| RTSPServer (streamer_t &streamer, int port=8554, int core=1) | |
| bool | begin () |
| Start server. | |
| bool | begin (const char *ssid, const char *password) |
| int | clientCount () |
| Get number of connected clients. | |
| void | end () |
| operator bool () | |
| Returns true if any client is connected. | |
| void | setOnSessionPath (bool(*cb)(const char *path, void *ref), void *ref=nullptr) |
| Set callback for session path. | |
| void | setSessionTimeoutMs (unsigned long ms) |
| Set session timeout in milliseconds. | |
Protected Member Functions | |
| void | acceptClient () |
| Accept new client if none is active. | |
| void | handleSession () |
| Handle requests session if active. | |
| void | serverThreadLoop () |
| void | sessionThreadLoop () |
Protected Attributes | |
| Platform::TcpClientType | client |
| int | client_count = 0 |
| int | core = 0 |
| unsigned long | lastRequestTime = 0 |
| bool(* | onSessionPathCb )(const char *, void *) = nullptr |
| void * | onSessionPathRef = nullptr |
| int | port = 554 |
| RtspSession< Platform > * | rtspSession = nullptr |
| Platform::TcpServerType * | server = nullptr |
| audio_tools::Task | serverTask {"RTSPServerThread", 10000, 5, core} |
| audio_tools::Task | sessionTask {"RTSPSessionTask", 8000, 8, core} |
| unsigned long | sessionTimeoutMs = 60000 |
| RTSPAudioStreamerBase< Platform > * | streamer = nullptr |
RTSPServer - Multi-client Audio Streaming Server (task-based)
This class extends RTSPServerBase to add task/thread management for handling RTSP sessions. It schedules the main server loop and individual session loops as tasks, allowing concurrent client handling on platforms that support threading (e.g., ESP32 with FreeRTOS).
Usage:
Inherits all protocol, session, and connection logic from RTSPServerBase. Only task scheduling and concurrency logic is implemented here.
| Platform | Target hardware platform (e.g., Arduino, ESP32) |
|
inlinevirtual |
Start server.
Reimplemented from RTSPServerBase< Platform >.