BASS_CONFIG_NET_TIMEOUT config option

The time to wait for a server to respond to a connection request.

BASS_SetConfig(
    BASS_CONFIG_NET_TIMEOUT,
    DWORD timeout
);

Parameters

timeoutThe time to wait, in milliseconds.

Remarks

The default timeout is 5 seconds (5000 milliseconds).

The BASS_CONFIG_THREAD flag can be used to make the setting specific to the current thread. When that is not 0, it will override the global setting in the current thread.

When playlist processing is enabled via the BASS_CONFIG_NET_PLAYLIST option, the timeout applies to each playlist entry rather than the playlist as a whole.

Example

Set the timeout to 3 seconds.
BASS_SetConfig(BASS_CONFIG_NET_TIMEOUT, 3000);

Set the timeout to 3 seconds only for one stream in the current thread.

BASS_SetConfig(BASS_CONFIG_NET_TIMEOUT | BASS_CONFIG_THREAD, 3000); // set the thread's timeout
HSTREAM stream = BASS_StreamCreateURL(url, 0, 0, NULL, NULL);
BASS_SetConfig(BASS_CONFIG_NET_TIMEOUT | BASS_CONFIG_THREAD, 0); // reset to the global timeout

See also

BASS_GetConfig, BASS_SetConfig, BASS_StreamCreateURL, BASS_CONFIG_NET_BUFFER, BASS_CONFIG_NET_READTIMEOUT