BarryServer : Git

All the code for all my projects
// BarryServer : Git / IRCWebHooks / blob / c75b43deceb4b63736f872922162eb42aa2c0885 / src / main.c

// Related

IRCWebHooks

Barry Disconnect recovery f3cb9f0 (3 years, 3 months ago)
#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <unistd.h>
#include <netdb.h>
#include <pthread.h>

#include "config.h"
#include "irc.h"
#include "webserver.h"

int
main(int argc, char *argv[])
{
	pthread_t srvThread, ircThread;
	pthread_create(&srvThread, NULL, (void *) srv, NULL);

	while (1) {
		pthread_create(&ircThread, NULL, (void *) bot, NULL);
		pthread_join(ircThread, NULL);
	}

	pthread_join(srvThread, NULL);

	return 0;
}