37 lines
557 B
C
37 lines
557 B
C
#include "control.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#define LATENCY 20
|
|
|
|
void trial_loop(trial *t) {
|
|
do {
|
|
if (-1 == trial_wait_for_start(t)) return;
|
|
if (t->finished) break;
|
|
while (t->alive) {
|
|
lookahead(t);
|
|
if (-1 == trial_check_input(t)) return;
|
|
}
|
|
trial_reset_run(t);
|
|
} while (!t->finished);
|
|
}
|
|
|
|
int main(int argc, char **argv) {
|
|
trial *t;
|
|
|
|
if (argc <= 2) {
|
|
fprintf(stderr, "Syntax: %s hostname port\n", argv[0]);
|
|
return 1;
|
|
}
|
|
|
|
if (NULL == (t = trial_new(argv[1], argv[2]))) {
|
|
return 2;
|
|
}
|
|
|
|
trial_loop(t);
|
|
|
|
trial_free(t);
|
|
|
|
return 0;
|
|
}
|