aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-10-18 17:56:51 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-10-18 17:56:51 +0300
commit89c8b90f8e52f9274996ffb6a2b0dc1214ea1010 (patch)
treee6562bafa220d38c502fdfb54091d6a542e1cce2 /src/util.h
parenta761bb36a4f5d6a1f229c465c4a57fe05637e278 (diff)
downloadrspamd-89c8b90f8e52f9274996ffb6a2b0dc1214ea1010.tar.gz
rspamd-89c8b90f8e52f9274996ffb6a2b0dc1214ea1010.zip
Add universal utility function for creating stream sockets.
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/util.h b/src/util.h
index 7a5a00915..7bdf3bdc4 100644
--- a/src/util.h
+++ b/src/util.h
@@ -44,7 +44,18 @@ gint accept_from_socket (gint listen_sock, struct sockaddr *addr, socklen_t *len
/*
* Create and bind or connect unix socket
*/
-gint make_unix_socket (const gchar *, struct sockaddr_un *, gboolean is_server);
+gint make_unix_socket (const gchar *, struct sockaddr_un *, gboolean is_server, gboolean async);
+
+/**
+ * Make universal stream socket
+ * @param credits host, ip or path to unix socket
+ * @param port port (used for network sockets)
+ * @param async make this socket asynced
+ * @param is_server make this socket as server socket
+ * @param try_resolve try name resolution for a socket (BLOCKING)
+ */
+gint make_universal_stream_socket (const gchar *credits, guint16 port,
+ gboolean async, gboolean is_server, gboolean try_resolve);
/*
* Create socketpair