testserver.c 530 Bytes
#include <stdio.h>
#include <socket.h>
#include <string.h>

#include "server.h"
#include "signalHandling.h"

static void
read_hook(const char * _buffer, size_t size)
{
	char buffer[1025];

	memset(buffer, 0, 1025);
	snprintf(buffer, size, _buffer);

	printf("%s\n", buffer);
}

int
main()
{
	LOGGER logger = new(LOGGER, NULL);
	SERVER server = new(SERVER, logger, 11212, SOMAXCONN);

	server->read_hook = read_hook;

	init_signals();
	server_run(server);

	delete(&server);
	delete(&logger);

	return 0;
}

// vim: set ts=4 sw=4: