You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
488 B

#include "tenant.h"
#include "tenant_functions.h"
/**
* Start the tenant as a server listening at tenant->port
* @param tenant
* @returns 0 on success, -1 on error
*/
int
tenant_listen(struct tenant *tenant)
{
int rc = tcp_server_listen(&tenant->tcp_server);
if (rc < 0) goto err;
rc = listener_thread_register_tenant(tenant);
if (unlikely(rc < 0)) goto err_add_to_epoll;
done:
return rc;
err_add_to_epoll:
tcp_server_close(&tenant->tcp_server);
err:
rc = -1;
goto done;
}