MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ close_endpoint()

void MayaFlux::Core::NetworkSubsystem::close_endpoint ( uint64_t  endpoint_id)

Close an endpoint.

Definition at line 310 of file NetworkSubsystem.cpp.

311{
312 auto* backend = resolve_backend(endpoint_id);
313 if (!backend) {
314 return;
315 }
316
317 backend->close_endpoint(endpoint_id);
318
319 {
320 std::unique_lock lock(m_routing_mutex);
321 m_endpoint_routing.erase(endpoint_id);
322 }
323
324 {
325 std::unique_lock lock(m_callbacks_mutex);
326 m_endpoint_callbacks.erase(endpoint_id);
327 }
328}
std::shared_mutex m_routing_mutex
Maps endpoint_id -> transport for routing send/close/query to the correct backend without scanning al...
std::unordered_map< uint64_t, NetworkTransport > m_endpoint_routing
std::unordered_map< uint64_t, NetworkReceiveCallback > m_endpoint_callbacks
std::shared_mutex m_callbacks_mutex
Per-endpoint receive callbacks set by consumers via set_endpoint_receive_callback().
INetworkBackend * resolve_backend(uint64_t endpoint_id) const
Resolve endpoint_id to its owning backend.