I'm getting a weird BASS_ERROR_TIMEOUT from BASS_StreamCreateURL after a while, typically 3-7 or a bit more days of continuous operation. The software works like this: connect to the stream with BASS_StreamCreateURL; play it; if the stream disconnects for some reason, reconnect. It works like this, but eventually the connection is no longer possible due to BASS_ERROR_TIMEOUT error.
Other programs are able to play this stream on the same computer. If the long-running program is restarted, it's also able to play the stream again. The error stops from happening if the network interface is reset e.g. turn OpenVPN on/off, then error no longer occurs for several days - in this case, the long-running program plays the stream again, no more error 40.
Stream is from Icecast KH server in MP3 format.
Using the latest version of BASS and other bass* libraries.
What could that be, and how can be fixed?