Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LARN
PRRT
Commits
9fb142d1
Commit
9fb142d1
authored
Mar 08, 2016
by
Andreas Schmidt
Browse files
Fix receiver program.
parent
ee4f00aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/receiver.c
View file @
9fb142d1
...
...
@@ -27,25 +27,22 @@ int main(int argc, char* const argv[]) {
sock
=
PrrtSocket_create
(
port
,
false
);
check
(
sock
!=
NULL
,
"Could not create socket."
);
printf
(
"SOCK: %d
\n
"
,
sock
->
receiveDataThread
);
int
i
=
1
;
while
(
keepRunning
)
{
unsigned
char
buffer
[
MAX_PAYLOAD_LENGTH
];
debug
(
"about to recv"
);
int
n
=
PrrtSocket_recv
(
sock
,
buffer
);
debug
(
"Done receiving"
);
if
(
n
<
0
)
{
printf
(
"n<0
\n
"
);
continue
;
}
buffer
[
n
]
=
'\0'
;
printf
(
"[B (n: %3d, i: %3d)] %s"
,
n
,
i
,
buffer
);
//
printf("[B (n: %3d, i: %3d)] %s", n, i, buffer);
i
++
;
usleep
(
1
);
}
PrrtSocket_close
(
sock
);
free
(
sock
);
pthread_exit
(
NULL
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment