Beispiel #1
0
Datei: unit.c Projekt: satrac/knc
int
runclient(int fd, char *service, char *hostname)
{
	struct knc_ctx	*ctx;

	fprintf(stderr, "runclient(), pid == %d\n", getpid());
	ctx = knc_init_fd(service, hostname, fd);
	return knc_loop(ctx);
}
Beispiel #2
0
Datei: unit.c Projekt: satrac/knc
int
runserver(int fd)
{
	struct knc_ctx	*ctx;

	fprintf(stderr, "runserver(), pid == %d\n", getpid());
	ctx = knc_accept_fd(NULL, NULL, fd);
	return knc_loop(ctx);
}
Beispiel #3
0
int
runserver(int fd)
{
	knc_ctx	ctx;

	fprintf(stderr, "runserver(), pid == %d\n", getpid());

	ctx = knc_ctx_init();

	knc_give_net_fd(ctx, fd);
	knc_accept(ctx);

	return knc_loop(ctx, 1);
}
Beispiel #4
0
int
runclient(int fd, const char *hostservice)
{
	knc_ctx ctx;

	fprintf(stderr, "runclient(), pid == %d\n", getpid());

	ctx = knc_ctx_init();

	knc_import_set_hb_service(ctx, hostservice, NULL);
	knc_give_net_fd(ctx, fd);
	knc_initiate(ctx);

	return knc_loop(ctx, 0);
}