client now sending to server
[irssi-notify.git] / server.c
index 74cf914..1da2bcd 100644 (file)
--- a/server.c
+++ b/server.c
@@ -115,8 +115,13 @@ int main(void)
 
                if (!fork()) { // this is the child process
                        close(sockfd); // child doesn't need the listener
-                       if (send(new_fd, "Hello, world!", 13, 0) == -1)
-                               perror("send");
+            char buf[100];
+            if (recv(new_fd, buf, 99, 0) == -1) {
+                perror("recv");
+                exit(1);
+            }
+            buf[100] = '\0';
+            printf("server: recieved '%s'\n", buf);
                        close(new_fd);
                        exit(0);
                }