Shows how to write a simple server using the Ecore_Con library.
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <Ecore.h>
#include <Ecore_Con.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
static void
tls_log_func(int level, const char *str)
{
fprintf(stderr, "|<%d>| %s", level, str);
}
#endif
{
}
{
}
{
char fmt[128];
snprintf(fmt, sizeof(fmt),
"Received %i bytes from client:\n"
">>>>>\n"
"%%.%is\n"
">>>>>\n",
}
int
main()
{
Ecore_Con_Server *svr;
#ifdef HAVE_GNUTLS
gnutls_global_set_log_level(9);
gnutls_global_set_log_function(tls_log_func);
#endif
if (!(svr =
ecore_con_server_add(ECORE_CON_REMOTE_TCP | ECORE_CON_USE_TLS | ECORE_CON_USE_SSL3 | ECORE_CON_LOAD_CERT,
"127.0.0.1", 8080, NULL)))
exit(1);
}