Skip to content

TCP Stream Port Not Released on Stream Removal #1497

@raj17ce

Description

@raj17ce

Describe the bug
When removing a TCP stream using the Stream.RemoveStream API, the TCP port is not released and remains bound to snapserver, preventing it from being reused.

Steps to Reproduce

  1. Add a TCP stream: {"jsonrpc":"2.0","method":"Stream.AddStream","params":{"streamUri":"tcp://127.0.0.1:53001?name=TCP1&mode=server"}}
  2. Remove the stream: {"jsonrpc":"2.0","method":"Stream.RemoveStream","params":{"id":"TCP1"}}
  3. Check with netstat -tunlp | grep 53001 - port is still bound to snapserver

Environment details

  • OS: Ubuntu 24.04, Linux (WSL2)
  • Snapcast version: 0.34.0
  • Self compiled from develop

Attach logfile if applicable

2026-01-30 18-06-24.484 [Notice] (ControlServer) New connection from: ::ffff:127.0.0.1, port: 1780
2026-01-30 18-06-24.493 [Info] (ControlRequest) Stream.AddStream(tcp://127.0.0.1:7000?name=TCP1&mode=server)
2026-01-30 18-06-24.493 [Info] (PcmStream) PcmStream: TCP1, sampleFormat: 48000:16:2
2026-01-30 18-06-24.493 [Info] (TcpStream) TcpStream host: 127.0.0.1, port: 7000, is server: 1
2026-01-30 18-06-24.496 [Info] (FlacEnc) Init - compression level: 2
2026-01-30 18-06-28.070 [Info] (ControlRequest) Stream.RemoveStream("TCP1")
2026-01-30 18-06-28.070 [Error] (TcpStream) Accept failed: Operation canceled
# Port 53001 still bound after removal

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