You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add shutdown handler for client to call and close alive sockets (#194)
* feat: add /shutdown endpoint to stop active streams (resolves#193)
Implements the feature requested in issue #193: a client-callable HTTP
endpoint that gracefully closes alive MJPEG/stream connections server-side,
preventing lingering TCP sockets when UI components unmount.
Changes:
- StreamerInterface: add virtual stop() (no-op default) and get_client_id()
- StreamerBase: implement stop() (marks inactive, releases connection) and
get_client_id(); populate client_id_ from 'client_id' query param
- WebVideoServer: register /shutdown route and implement handle_shutdown()
which stops all streams for a topic, or a single named stream if
client_id is provided; returns plain-text 'stopped=<count>'
- README: document /shutdown endpoint, parameters, and client_id usage
Rewrite of PR #194 adapted to the pluginlib-based architecture introduced
in #192 and the naming/style conventions enforced by #195.
* Update include/web_video_server/streamer.hpp
make pure virtual
Co-authored-by: Błażej Sowa <bsowa123@gmail.com>
* Update include/web_video_server/streamer.hpp
make pure virtual
Co-authored-by: Błażej Sowa <bsowa123@gmail.com>
* feat-193: fixed client_id empty logging
---------
Co-authored-by: Błażej Sowa <bsowa123@gmail.com>
The response is plain text in the form `stopped=<count>`, where `<count>` is the number of streams that were stopped. Returns `400 Bad Request` if `topic` is omitted.
202
+
203
+
#### URL Parameters for Shutdown
204
+
205
+
| Parameter | Type | Default | Description |
206
+
|-----------|------|---------|-------------|
207
+
|`topic`| string | (required) | The ROS topic whose streams should be stopped |
208
+
|`client_id`| string | (none) | If provided, only the stream with this client_id is stopped |
209
+
181
210
## Creating custom streamer plugins
182
211
See the [custom streamer plugin tutorial](doc/custom-streamer-plugin.md) for information on how to write your own streamer plugins.
0 commit comments