mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 01:26:58 +00:00
add user_data in esl_listen so the main function can pass a private user_data to callback
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <esl.h>
|
||||
|
||||
static void mycallback(esl_socket_t server_sock, esl_socket_t client_sock, struct sockaddr_in *addr)
|
||||
static void mycallback(esl_socket_t server_sock, esl_socket_t client_sock, struct sockaddr_in *addr, void *user_data)
|
||||
{
|
||||
esl_handle_t handle = {{0}};
|
||||
int done = 0;
|
||||
@@ -48,7 +48,7 @@ static void mycallback(esl_socket_t server_sock, esl_socket_t client_sock, struc
|
||||
int main(void)
|
||||
{
|
||||
esl_global_set_default_logger(7);
|
||||
esl_listen_threaded("localhost", 8040, mycallback, 100000);
|
||||
esl_listen_threaded("localhost", 8040, mycallback, NULL, 100000);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user