Owns transports and sessions and routes generic track handlers to a session.
More...
#include <session_manager.h>
Owns transports and sessions and routes generic track handlers to a session.
The manager retains every server session until its connection closes. A client session is likewise retained internally; callers receive a weak reference. Destruction shuts down all transports.
- Examples
- simple_publish/main.cpp, and simple_subscribe/main.cpp.
◆ SessionManager() [1/4]
| quicr::SessionManager::SessionManager |
( |
std::shared_ptr< Logger > |
logger = nullptr | ) |
|
Construct with default callbacks and an internally created tick service per transport.
- Parameters
-
| logger | Optional logger shared by created transports and sessions. |
◆ SessionManager() [2/4]
| quicr::SessionManager::SessionManager |
( |
std::shared_ptr< Callbacks > |
callbacks, |
|
|
std::shared_ptr< Logger > |
logger = nullptr |
|
) |
| |
Construct with callbacks and an internally created tick service per transport.
- Parameters
-
| callbacks | Callback receiver. |
| logger | Optional logger shared by created transports and sessions. |
- Precondition
callbacks must not be null.
◆ SessionManager() [3/4]
| quicr::SessionManager::SessionManager |
( |
std::shared_ptr< Clock > |
clock, |
|
|
std::shared_ptr< Logger > |
logger = nullptr |
|
) |
| |
Construct with default callbacks and a shared tick service.
- Parameters
-
| clock | Clock service shared by created transports; null selects an internal clock service per transport. |
| logger | Optional logger shared by created transports and sessions. |
◆ SessionManager() [4/4]
| quicr::SessionManager::SessionManager |
( |
std::shared_ptr< Callbacks > |
callbacks, |
|
|
std::shared_ptr< Clock > |
clock, |
|
|
std::shared_ptr< Logger > |
logger = nullptr |
|
) |
| |
Construct with callbacks and a shared tick service.
- Parameters
-
| callbacks | Callback receiver. |
| clock | Service shared by created transports; null selects an internal service per transport. |
| logger | Optional logger shared by created transports and sessions. |
- Precondition
callbacks must not be null.
◆ ~SessionManager()
| quicr::SessionManager::~SessionManager |
( |
| ) |
|
Shut down all transports owned by the manager.
◆ AddHandler()
| void quicr::SessionManager::AddHandler |
( |
const std::shared_ptr< Session > & |
session, |
|
|
std::shared_ptr< TrackHandler > |
handler |
|
) |
| |
Register a concrete track or namespace handler with a session.
- Parameters
-
| session | Target session; the manager does not take additional ownership. |
| handler | Handler whose dynamic type selects the session operation. |
- Exceptions
-
| std::invalid_argument | if session is null or handler has an unsupported dynamic type. |
- Examples
- simple_publish/main.cpp, and simple_subscribe/main.cpp.
◆ AddTransport() [1/2]
Create a client transport and wait for its session to be established.
- Parameters
-
| config | Client and transport configuration. |
| callbacks | Session callbacks; null uses no application callbacks. |
- Returns
- Weak reference to the manager-owned session, or an empty reference if the URI is invalid, transport startup fails, or no session appears before the configured idle timeout.
- Examples
- simple_publish/main.cpp, and simple_subscribe/main.cpp.
◆ AddTransport() [2/2]
Create and start a server transport.
- Parameters
-
| config | Server and transport configuration. |
| callbacks | Callbacks shared by sessions accepted by this transport; null uses no session callbacks. |
- Note
- Accepted sessions are reported asynchronously through
Callbacks::OnNewServerSession.
◆ RemoveHandler()
| void quicr::SessionManager::RemoveHandler |
( |
const std::shared_ptr< Session > & |
session, |
|
|
const std::shared_ptr< TrackHandler > & |
handler |
|
) |
| |
Remove a concrete track or namespace handler from a session.
- Parameters
-
| session | Target session. |
| handler | Previously registered handler whose dynamic type selects the removal operation. |
- Exceptions
-
| std::invalid_argument | if session is null or handler has an unsupported dynamic type. |
The documentation for this class was generated from the following file: