LJM_STREAM_RECEIVE_TIMEOUT_MS
Manually sets the timeout for LJM's stream data collection. Writing to this configuration sets LJM_STREAM_RECEIVE_TIMEOUT_MODE
to LJM_STREAM_RECEIVE_TIMEOUT_MODE_MANUAL
.
Writing a non-zero value to LJM_STREAM_RECEIVE_TIMEOUT_MS
will manually set the timeout for LJM's stream data collection. Note that using LJM_STREAM_RECEIVE_TIMEOUT_MODE
of LJM_STREAM_RECEIVE_TIMEOUT_MODE_CALCULATED
is almost always better than using manual non-zero LJM_STREAM_RECEIVE_TIMEOUT_MS
value.
A value of 0 should not be written to LJM_STREAM_RECEIVE_TIMEOUT_MS
. This corresponds to an infinite timeout period and it could lead to a deadlock condition in LJM. Instead, write a large non-zero value. This should only be necessary for externally clocked or triggered stream modes where the necessary clock/trigger may not occur within a normal milliseconds long timeout period.
The constant LJM_STREAM_RECEIVE_TIMEOUT_MS
can be used interchangeably with the string "LJM_STREAM_RECEIVE_TIMEOUT_MS"
.
Default
The default timeout is 20000 ms.
Remarks
LJM_STREAM_RECEIVE_TIMEOUT_MS
does not affect currently running or already initialized streams.
Relevant Functions
To read LJM_STREAM_RECEIVE_TIMEOUT_MS
, use LJM_ReadLibraryConfigS.
To write LJM_STREAM_RECEIVE_TIMEOUT_MS
, use LJM_WriteLibraryConfigS orLJM_LoadConfigurationFile.
LJM_STREAM_RECEIVE_TIMEOUT_MS
affects the behavior of LJM_eStreamRead.
Example
Set the LJM_STREAM_RECEIVE_TIMEOUT_MS mode to 5 seconds.
char ErrorString[LJM_MAX_NAME_SIZE];
int LJMError = 0;
LJMError = LJM_WriteLibraryConfigS(
LJM_STREAM_RECEIVE_TIMEOUT_MS,
5000
);
if (LJMError != LJME_NOERROR) {
LJM_ErrorToString(LJMError, ErrorString);
printf("LJM_WriteLibraryConfigS error: %s\n", ErrorString);
}
For more LJM configurations, see Library Configuration Functions.