Skip to content

Add shutdown feature for open TCP sockets #193

@varunverlencar

Description

@varunverlencar

there's no lifecycle cleanup for the MJPEG stream that comes from web_video_server. Key spots:

on our custom UI

  • the UI component hard-codes videoStreamUrl to http://{deviceIp}:8080 (the default web_video_server port) and never tears it down.
  • live preview is just an whose src is ${videoStreamUrl}/stream?topic=/image. Unmounting the React component simply removes the , but the HTTP connection remains open on the server side until the browser closes the socket; there's no call back into ROS to close the session.
  • There's no useEffect cleanup toggling livePreview back to false or hitting /shutdown on web_video_server, so once the preview is turned on the MJPEG stream stays active even after leaving the page. That's why we keep seeing the timed-out port sessions: the server never receives a cancel/stop request.
lsof -iTCP:8080 -sTCP:ESTABLISHED -P -n
COMMAND      PID                             USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
web_video 230596 varun.verlencar   47u  IPv4 5249642      0t0  TCP 127.0.0.1:8080->127.0.0.1:39890 (ESTABLISHED)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions