aboutsummaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2022-10-17 23:04:12 +0300
committerkartofen <mladenovnasko0@gmail.com>2022-10-17 23:04:12 +0300
commit7e64d0c78e8a21f2ede7eab1303758391001c0dc (patch)
treea01e44b12d66de3e4fbc5cf5ab20f439fc8d6fc8 /src/socket.c
parentb1b7c92aa96af5502f276819b628b05d54f4655c (diff)
many changes in progess
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/socket.c b/src/socket.c
index f435812..838df53 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -84,14 +84,14 @@ int listener(char *port, void (*on_recv)(char *, int))
printf("FPS: %d\n", i);
i = 0;
- struct sigaction sa;
- sa.sa_handler = sigchld_handler; // reap all dead processes
- sigemptyset(&sa.sa_mask);
- sa.sa_flags = SA_RESTART;
- if (sigaction(SIGCHLD, &sa, NULL) == -1) {
- perror("sigaction");
- return 1;
- }
+ // struct sigaction sa;
+ // sa.sa_handler = sigchld_handler; // reap all dead processes
+ // sigemptyset(&sa.sa_mask);
+ // sa.sa_flags = SA_RESTART;
+ // if (sigaction(SIGCHLD, &sa, NULL) == -1) {
+ // perror("sigaction");
+ // return 1;
+ // }
}
char buf[BUF_CAP] = {0};
@@ -113,7 +113,14 @@ int listener(char *port, void (*on_recv)(char *, int))
s, sizeof(s)), numbytes);
#endif
- on_recv(buf, numbytes);
+ // #include <stdlib.h>
+
+ // pid_t p = fork();
+ // if(p < -1) { return 69; }
+ // else if(p == 0) {
+ on_recv(buf, numbytes);
+ // exit(0);
+ // }
i++;
}