***/
typedef struct SilcNetListenerStruct *SilcNetListener;
-/****d* silcutil/SilcNetAPI/SilcNetStatus
- *
- * NAME
- *
- * typedef enum { ... } SilcNetStatus;
- *
- * DESCRIPTION
- *
- * Status to indicate the result of the network operation creation. This
- * type is returned in the SilcNetCallback callback function.
- *
- * SOURCE
- */
-typedef enum {
- SILC_NET_OK, /* Everything Ok */
- SILC_NET_UNKNOWN_IP, /* Unknown IP address */
- SILC_NET_UNKNOWN_HOST, /* Unknown hostname */
- SILC_NET_HOST_UNREACHABLE, /* Destination unreachable */
- SILC_NET_CONNECTION_REFUSED, /* Connection refused */
- SILC_NET_CONNECTION_TIMEOUT, /* Connection timedout */
- SILC_NET_NO_MEMORY, /* System out of memory */
- SILC_NET_ERROR, /* Unknown error */
-} SilcNetStatus;
-/***/
-
/****f* silcutil/SilcNetAPI/SilcNetCallback
*
* SYNOPSIS
*
- * typedef void (*SilcNetCallback)(SilcNetStatus status,
+ * typedef void (*SilcNetCallback)(SilcResult status,
* SilcStream stream, void *context);
*
* DESCRIPTION
* the `stream'.
*
***/
-typedef void (*SilcNetCallback)(SilcNetStatus status,
+typedef void (*SilcNetCallback)(SilcResult status,
SilcStream stream, void *context);
/****f* silcutil/SilcNetAPI/silc_net_tcp_create_listener
* is zero (0), operating system will define it automatically.
*
* The `callback' always delivers valid new stream. It is not called
- * with an error status.
+ * with an error status. If `schedule' is NULL this will call
+ * silc_schedule_get_global to try to get global scheduler.
*
***/
SilcNetListener
* then the incoming connection hostname will be resolved.
*
* The `callback' always delivers valid new stream. It is not called
- * with an error status.
+ * with an error status. If `schedule' is NULL this will call
+ * silc_schedule_get_global to try to get global scheduler.
*
***/
SilcNetListener
* The returned SilcAsyncOperation context can be used to control the
* asynchronous connecting, such as to abort it. If it is aborted
* using silc_async_abort the `callback' will not be called. If NULL
- * is returned the operation cannot be aborted.
+ * is returned the operation cannot be aborted. If `schedule' is NULL
+ * this will call silc_schedule_get_global to try to get global scheduler.
*
***/
SilcAsyncOperation silc_net_tcp_connect(const char *local_ip_addr,
* To read the packet use silc_stream_read if the remote address was
* provided, and silc_net_udp_receive if it was not.
*
- * Supports IPv6 if the platform supports it.
+ * Supports IPv6 if the platform supports it. If `schedule' is NULL this
+ * will call silc_schedule_get_global to try to get global scheduler.
*
* EXAMPLE
*
const char *remote_ip_addr, int remote_port,
const unsigned char *data, SilcUInt32 data_len);
-/****f* silcutil/SilcNetAPI/silc_net_get_error_string
- *
- * SYNOPSIS
- *
- * const char silc_net_get_error_string(SilcNetStatus error);
- *
- * DESCRIPTION
- *
- * Return `error' as a string.
- *
- ***/
-const char *silc_net_get_error_string(SilcNetStatus error);
-
/****f* silcutil/SilcNetAPI/silc_net_close_connection
*
* SYNOPSIS
* Asynchronously resolves the IP address of the hostname indicated
* by the `name'. This function returns immediately, and the
* `completion' callback will be called after the resolving is
- * completed.
+ * completed. If `schedule' is NULL this will call silc_schedule_get_global
+ * to try to get global scheduler.
*
* If the `prefer_ipv6' is TRUE then this will return IPv6 address if it
* finds. If FALSE if returns IPv4 address even if it found IPv6
* Asynchronously resolves the hostname for the IP address indicated
* by the `addr'. This function returns immediately, and the
* `completion' callback will be called after the resolving is
- * completed.
+ * completed. If `schedule' is NULL this will call silc_schedule_get_global
+ * to try to get global scheduler.
*
***/
void silc_net_gethostbyaddr_async(const char *addr,