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
- Add a TCP stream:
{"jsonrpc":"2.0","method":"Stream.AddStream","params":{"streamUri":"tcp://127.0.0.1:53001?name=TCP1&mode=server"}}
- Remove the stream:
{"jsonrpc":"2.0","method":"Stream.RemoveStream","params":{"id":"TCP1"}}
- 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
Describe the bug
When removing a TCP stream using the
Stream.RemoveStreamAPI, the TCP port is not released and remains bound to snapserver, preventing it from being reused.Steps to Reproduce
{"jsonrpc":"2.0","method":"Stream.AddStream","params":{"streamUri":"tcp://127.0.0.1:53001?name=TCP1&mode=server"}}{"jsonrpc":"2.0","method":"Stream.RemoveStream","params":{"id":"TCP1"}}netstat -tunlp | grep 53001- port is still bound to snapserverEnvironment details
Attach logfile if applicable