silc_buffer_stream_create

SYNOPSIS

    SilcStream silc_buffer_stream_create(SilcStream stream,
                                         SilcBufferReceiveCallback receiver,
                                         void *context);

DESCRIPTION

Creates a buffer stream and returns it. The `stream' is the underlaying stream to be used to actually send the buffer and receive buffers. The returned stream is used with this API to send the buffers. The `stream' must stay valid as long the buffer stream is used.

To send buffers to the stream silc_buffer_stream_send can be used. The silc_stream_write cannot be used with the returned stream. Buffers coming from the `stream' will be delivered to the `receiver' callback. The returned stream and `context' will also be delivered to `receiver'.

The returned stream must be destroyed by calling silc_stream_destroy. Other SilcStream API functions cannot be used with buffer stream.