diff rvinterf/lowlevel/localsock.c @ 185:ec040f521cc2

rvinterf works after fixing max_fd
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 24 Nov 2013 20:27:21 +0000
parents 7ab6b29e76bb
children f5f8776f7c66
line wrap: on
line diff
--- a/rvinterf/lowlevel/localsock.c	Sun Nov 24 08:40:44 2013 +0000
+++ b/rvinterf/lowlevel/localsock.c	Sun Nov 24 20:27:21 2013 +0000
@@ -97,6 +97,8 @@
 		perror("rvinterf: accept");
 		exit(1);
 	}
+	if (rc > max_fd)
+		max_fd = rc;
 	newcli = malloc(sizeof(struct client));
 	if (!newcli) {
 		perror("rvinterf: malloc for new client");
@@ -107,6 +109,7 @@
 	newcli->next = client_head;
 	client_head = newcli;
 	prep_for_length_rx(newcli);
+	output_line("*** Client program connected");
 	return(0);
 }
 
@@ -135,6 +138,7 @@
 	cc = read(cli->fd, cli->rx_ptr, cli->rx_left);
 	if (cc <= 0) {
 		/* normal client exit condition */
+		output_line("*** Client program disconnected");
 close_socket:	cli->rx_state = 2;
 		return;
 	}