Call Us Today! 877.742.2583




Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: add code block for C

...

Basically, the esl_listen_threaded takes a callback function that, when a new connection comes in, runs the callback - mycallback in this case.

Code Block
languagecpp
int main(void)
{
	esl_global_set_default_logger(7);
	esl_listen_threaded("localhost", 8040, mycallback, 100000);
	
	return 0;
}

the 1.4 vesion (master from 2014-02-16) added a private user_data param that allows you pass user_data to the callback, e.g.

Code Block
languagecpp
int main(void)
{
	char *private_data = "some private string or struct ...";

	esl_global_set_default_logger(7);
	esl_listen_threaded("localhost", 8040, mycallback, private_data, 100000);
	
	return 0;
}

See Also