Commit b495a407 authored by Philipp Schafft's avatar Philipp Schafft 🦁

Feature: Added listensocket_container_configure_and_setup() that combines...

Feature: Added listensocket_container_configure_and_setup() that combines configure and setup into one call
parent a6ff1cb2
......@@ -186,6 +186,29 @@ int listensocket_container_configure(listensocket_contai
return 0;
}
int listensocket_container_configure_and_setup(listensocket_container_t *self, const ice_config_t *config)
{
void (*cb)(size_t count, void *userdata);
int ret;
if (!self)
return -1;
cb = self->sockcount_cb;
self->sockcount_cb = NULL;
if (listensocket_container_configure(self, config) == 0) {
ret = listensocket_container_setup(self);
} else {
ret = -1;
}
self->sockcount_cb = cb;
__call_sockcount_cb(self);
return ret;
}
int listensocket_container_setup(listensocket_container_t *self) {
size_t i;
int ret = 0;
......
......@@ -14,6 +14,7 @@
listensocket_container_t * listensocket_container_new(void);
int listensocket_container_configure(listensocket_container_t *self, const ice_config_t *config);
int listensocket_container_configure_and_setup(listensocket_container_t *self, const ice_config_t *config);
int listensocket_container_setup(listensocket_container_t *self);
connection_t * listensocket_container_accept(listensocket_container_t *self, int timeout);
int listensocket_container_set_sockcount_cb(listensocket_container_t *self, void (*cb)(size_t count, void *userdata), void *userdata);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment