From 9d15452d00945770b8f297daed2e5f030f419202 Mon Sep 17 00:00:00 2001 From: Oskar Date: Mon, 3 Jun 2024 17:33:47 +0200 Subject: made it so the client can keep accepting new connections --- client.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'client.c') diff --git a/client.c b/client.c index d0ef45f..eac217c 100644 --- a/client.c +++ b/client.c @@ -21,7 +21,13 @@ int sockfd = -1; size_t bytes_sent = 0; void talk_to_server (int sockfd) { - + + fprintf(stdout, "Waiting to connect...\n"); + int rcv_ret; + char buf_connected[11]; + rcv_ret = recv(sockfd, buf_connected, 11, 0); + buf_connected[rcv_ret] = '\0'; + fprintf(stdout, "%s", buf_connected); while (1) { char editbuffer[BUF_SZ_2]; fprintf(stdout, ": "); -- cgit v1.2.3