Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2005 - 2006 Pekka Riikonen
+ Copyright (C) 2005 - 2007 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
typedef enum {
SILC_STREAM_CAN_READ, /* Data available for reading */
SILC_STREAM_CAN_WRITE, /* Stream ready for writing */
- SILC_STREAM_EOS, /* End of stream */
- SILC_STREAM_CLOSED, /* Stream is closed */
- SILC_STREAM_INVALID, /* Stream is invalid */
- SILC_STREAM_NO_MEMORY, /* System out of memory */
- SILC_STREAM_ERROR, /* Unknown error */
} SilcStreamStatus;
/***/
* the notifier callback will later be called with SILC_STREAM_CAN_READ
* status when stream is again ready for reading.
*
+ * If error occurred the error code can be retrieved with silc_errno.
+ *
***/
int silc_stream_read(SilcStream stream, unsigned char *buf,
SilcUInt32 buf_len);
* notifier callback will later be called with SILC_STREAM_CAN_WRITE
* status when stream is again ready for writing.
*
+ * If error occurred the error code can be retrieved with silc_errno.
+ *
***/
int silc_stream_write(SilcStream stream, const unsigned char *data,
SilcUInt32 data_len);
*
* DESCRIPTION
*
- * Set a notifier callback for the stream indicated by `stream' to be called
- * when some action takes place on the stream. This effectively means
- * scheduling the stream for various actions, that then eventually will
- * be delivered to caller in the `notifier' callback. It is called for
- * example when data is available for reading or writing, or if an error
- * occurs. This can be called at any time for valid stream.
+ * Schedule `stream' for stream events. Set the `notifier' callback to
+ * be called when some event takes place on the stream. The event will
+ * be delievered to the `notifier' callback with the `context'. It is
+ * called for example when data is available for reading or writing, or
+ * if an error occurs. This can be called at any time for valid stream.
+ * This call will also set the `stream' into non-blocking mode.
*
* If `notifier' is set to NULL no callback will be called for the stream,
* and the stream is not scheduled anymore.