Main Content

rtIOStreamClose

Shut down communications channel

Description

errFlg = rtIOStreamClose(streamID) shuts down the communications channel and cleans up associated resources.

example

Examples

Close Communications Channel

This code from rtiostreamtest.c detects errors when closing the communications channel.

static int closeServer(void)
{
    const int errorOccurred = rtIOStreamClose(streamID);
    if (errorOccurred == RTIOSTREAM_ERROR)
    {
        return errorOccurred;
    }
    return RTIOSTREAM_NO_ERROR;
}

Input Arguments

collapse all

Handle to the stream returned by a previous call to rtIOStreamOpen.

Output Arguments

collapse all

If the function runs without errors, it returns zero. Otherwise, it returns -1.

The rtiostream.h file defines these macros:

#define RTIOSTREAM_ERROR (-1)
#define RTIOSTREAM_NO_ERROR (0)

Version History

Introduced in R2009a