mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-05 22:08:23 +00:00
Improve err handling in pubsub example
PUBLISHED_FROM=7660e252e1ac84bf2245718c548fb00288ff4e47
This commit is contained in:
1 parent
e5b3b8ad32
commit
bd15ad4301
1 file changed
+3
-1
@@ -23,7 +23,9 @@ static void *stdin_thread(void *param) {
|
|||||||
// Forward all types characters to the socketpair
|
// Forward all types characters to the socketpair
|
||||||
while ((ch = getchar()) != EOF) {
|
while ((ch = getchar()) != EOF) {
|
||||||
unsigned char c = (unsigned char) ch;
|
unsigned char c = (unsigned char) ch;
|
||||||
send(sock, (const char *) &c, 1, 0);
|
if (send(sock, (const char *) &c, 1, 0) < 0) {
|
||||||
|
fprintf(stderr, "Failed to send byte to the socket");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user