Added SILC Thread Queue API
[silc.git] / lib / silcutil / silcsocketstream.h
index e9fd435782959fd2e3298047571d4c2c77e9e3bb..46cce4faede773f7accd4678d7eceab457d746f6 100644 (file)
 #ifndef SILCSOCKETSTREAM_H
 #define SILCSOCKETSTREAM_H
 
-/****d* silcutil/SilcSocketStreamAPI/SilcSocketStreamStatus
- *
- * NAME
- *
- *    typedef enum { ... } SilcStreamStatus;
- *
- * DESCRIPTION
- *
- *    Socket Stream status.  This status is returned into the
- *    SilcSocketStreamCallback function after the socket stream is
- *    created.
- *
- * SOURCE
- */
-typedef enum {
-  SILC_SOCKET_OK,              /* Normal status */
-  SILC_SOCKET_UNKNOWN_IP,      /* Remote does not have IP address */
-  SILC_SOCKET_UNKNOWN_HOST,    /* Remote does not have host name */
-  SILC_SOCKET_NO_MEMORY,       /* System out of memory */
-  SILC_SOCKET_ERROR,           /* Unknown error */
-} SilcSocketStreamStatus;
-/***/
-
 /****f* silcutil/SilcSocketStreamAPI/SilcSocketStreamCallback
  *
  * SYNOPSIS
  *
- *    typedef void (*SilcSocketStreamCallback)(SilcSocketStreamStatus status,
+ *    typedef void (*SilcSocketStreamCallback)(SilcResult status,
  *                                             SilcStream stream,
  *                                             void *context);
  *
@@ -82,7 +59,7 @@ typedef enum {
  *    non-blocking mode.
  *
  ***/
-typedef void (*SilcSocketStreamCallback)(SilcSocketStreamStatus status,
+typedef void (*SilcSocketStreamCallback)(SilcResult status,
                                         SilcStream stream, void *context);
 
 /****f* silcutil/SilcSocketStreamAPI/silc_socket_tcp_stream_create
@@ -116,7 +93,8 @@ typedef void (*SilcSocketStreamCallback)(SilcSocketStreamStatus status,
  *    also return NULL as the `callback' is called immediately.
  *
  *    If the silc_stream_set_notifier is called the stream is set to
- *    non-blocking mode.
+ *    non-blocking mode.  If `schedule' is NULL this will call
+ *    silc_schedule_get_global to try to get global scheduler.
  *
  ***/
 SilcAsyncOperation
@@ -159,7 +137,8 @@ silc_socket_tcp_stream_create(SilcSocket sock, SilcBool lookup,
  *    This function returns the created SilcStream or NULL on error.
  *
  *    If the silc_stream_set_notifier is called the stream is set to
- *    non-blocking mode.
+ *    non-blocking mode.  If `schedule' is NULL this will call
+ *    silc_schedule_get_global to try to get global scheduler.
  *
  ***/
 SilcStream silc_socket_udp_stream_create(SilcSocket sock,
@@ -231,20 +210,6 @@ SilcBool silc_socket_stream_set_info(SilcStream stream,
                                     const char *hostname,
                                     const char *ip, SilcUInt16 port);
 
-/****f* silcutil/SilcSocketStreamAPI/silc_socket_stream_get_error
- *
- * SYNOPSIS
- *
- *    int silc_socket_stream_get_error(SilcStream stream);
- *
- * DESCRIPTION
- *
- *    If error occurred during socket stream operations, this function
- *    can be used to retrieve the error number that occurred.
- *
- ***/
-int silc_socket_stream_get_error(SilcStream stream);
-
 /****f* silcutil/SilcSocketStreamAPI/silc_socket_stream_set_qos
  *
  * SYNOPSIS