better error handling for when accept fails

This commit is contained in:
Godmar Back 2018-04-29 17:58:19 -04:00
parent fc4135a79c
commit 3e05379763

View File

@ -26,7 +26,7 @@ static void
server_loop(char *port_string)
{
int accepting_socket = socket_open_bind_listen(port_string, 1024);
for (;;) {
while (accepting_socket != -1) {
fprintf(stderr, "Waiting for client...\n");
int client_socket = socket_accept_client(accepting_socket);
if (client_socket == -1)