-t parameter implemented
This commit is contained in:
parent
7ab8eb1b6b
commit
562e1942d4
|
@ -23,7 +23,8 @@ int parseArgs(struct prog_info *pinfo, int argc, char **argv) {
|
||||||
printf( " -c <num> run in client mode\n");
|
printf( " -c <num> run in client mode\n");
|
||||||
printf( " num is the column offset to use.\n");
|
printf( " num is the column offset to use.\n");
|
||||||
printf( " -p <port> use the specified port\n");
|
printf( " -p <port> use the specified port\n");
|
||||||
printf( " -t <fps> when in server mode: update <fps> times per second\n");
|
printf( " -t <fps> when in server mode: update <fps> times\n");
|
||||||
|
printf( " per second. Valid range: 2 - 99\n");
|
||||||
printf( " no use in client mode\n");
|
printf( " no use in client mode\n");
|
||||||
printf("\n\n");
|
printf("\n\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -65,7 +66,7 @@ int parseArgs(struct prog_info *pinfo, int argc, char **argv) {
|
||||||
return -6;
|
return -6;
|
||||||
}
|
}
|
||||||
pinfo->fps = (int)strtol(argv[++i], NULL, 10);
|
pinfo->fps = (int)strtol(argv[++i], NULL, 10);
|
||||||
if (pinfo->fps <= 0 || 50 <= pinfo->fps) {
|
if (pinfo->fps <= 1 || 50 <= pinfo->fps) {
|
||||||
printf("fps invalid!\n");
|
printf("fps invalid!\n");
|
||||||
return -7;
|
return -7;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ int run_server(const struct prog_info *pinfo) {
|
||||||
|
|
||||||
struct timespec tim;
|
struct timespec tim;
|
||||||
tim.tv_sec = 0;
|
tim.tv_sec = 0;
|
||||||
tim.tv_nsec = 50000000;
|
tim.tv_nsec = 1000000000 / pinfo->fps;
|
||||||
|
|
||||||
// Einem Socket muss das Broadcasting explizit erlaubt werden:
|
// Einem Socket muss das Broadcasting explizit erlaubt werden:
|
||||||
int broadcastPermission = 1;
|
int broadcastPermission = 1;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user