attempted to add commands

This commit is contained in:
2025-08-07 12:05:08 -06:00
parent 4fff0db858
commit 71835bf84a
+8 -1
View File
@@ -79,6 +79,9 @@ void *sender(void *arg) {
move(row - 1, 0); move(row - 1, 0);
clrtoeol(); clrtoeol();
refresh(); refresh();
if ((strncmp(msg, "/c", 3)) == 0) {
pthread_exit(&closed);
}
if (bytes == -1) { if (bytes == -1) {
perror("send"); perror("send");
pthread_exit(&error); pthread_exit(&error);
@@ -94,7 +97,7 @@ void *receiver(void *arg) {
while (1) { while (1) {
memset(buf, 0, 128); memset(buf, 0, 128);
bytes = recv(confd, buf, 128, 0); bytes = recv(confd, buf, 128, 0);
buf[bytes] = '\0';
if (bytes != -1) { if (bytes != -1) {
move(0, 0); move(0, 0);
deleteln(); deleteln();
@@ -111,6 +114,10 @@ void *receiver(void *arg) {
perror("recv"); perror("recv");
pthread_exit(&error); pthread_exit(&error);
} }
if ((strncmp(buf, "/c", 3)) == 0) {
pthread_exit(&closed);
}
} }
return 0; return 0;