예제 #1
0
파일: bsd.c 프로젝트: abpin/kore
void
kore_platform_event_init(void)
{
	if ((kfd = kqueue()) == -1)
		fatal("kqueue(): %s", errno_s);

	nchanges = 0;
	event_count = worker_max_connections + 1;
	events = kore_calloc(event_count, sizeof(struct kevent));
	changelist = kore_calloc(event_count, sizeof(struct kevent));

	kore_platform_event_schedule(server.fd,
	    EVFILT_READ, EV_ADD | EV_DISABLE, &server);
}
예제 #2
0
파일: linux.c 프로젝트: cremno/kore
void
kore_platform_event_init(void)
{
	if ((efd = epoll_create(10000)) == -1)
		fatal("epoll_create(): %s", errno_s);

	event_count = worker_max_connections + 1;
	events = kore_calloc(event_count, sizeof(struct epoll_event));
}
예제 #3
0
파일: pgsql_cb.c 프로젝트: jorisvink/kore
void
connection_new(struct connection *c)
{
	struct kore_pgsql	*pgsql;

	c->disconnect = connection_del;
	c->proto = CONN_PROTO_UNKNOWN;
	c->state = CONN_STATE_ESTABLISHED;

	pgsql = kore_calloc(1, sizeof(*pgsql));

	kore_pgsql_init(pgsql);
	kore_pgsql_bind_callback(pgsql, db_state_change, c);

	c->hdlr_extra = pgsql;
	printf("new connection %p\n", (void *)c);

	db_init(c, pgsql);
}