version 1.8, 1999/03/03 15:42:46 |
version 1.9, 1999/03/03 20:43:30 |
|
|
continue; |
continue; |
} |
} |
/* panic, we don't know what happened */ |
/* panic, we don't know what happened */ |
p_error("Unexpected error from select"); |
quit("Unexpected error from select", 1); |
quit(); |
|
} |
} |
if (FD_ISSET(sockt, &read_set)) { |
if (FD_ISSET(sockt, &read_set)) { |
/* There is data on sockt */ |
/* There is data on sockt */ |
nb = read(sockt, buf, sizeof buf); |
nb = read(sockt, buf, sizeof buf); |
if (nb <= 0) { |
if (nb <= 0) |
message("Connection closed. Exiting"); |
quit("Connection closed. Exiting", 0); |
quit(); |
|
} |
|
display(&his_win, buf, nb); |
display(&his_win, buf, nb); |
} |
} |
if (FD_ISSET(fileno(stdin), &read_set)) { |
if (FD_ISSET(fileno(stdin), &read_set)) { |
|
|
write(sockt, buf, nb); |
write(sockt, buf, nb); |
} |
} |
} |
} |
} |
|
|
|
/* |
|
* p_error prints the system error message on the standard location |
|
* on the screen and then exits. (i.e. a curses version of perror) |
|
*/ |
|
void |
|
p_error(string) |
|
char *string; |
|
{ |
|
wmove(my_win.x_win, current_line%my_win.x_nlines, 0); |
|
wprintw(my_win.x_win, "[%s : %s (%d)]\n", |
|
string, strerror(errno), errno); |
|
wrefresh(my_win.x_win); |
|
move(LINES-1, 0); |
|
refresh(); |
|
quit(); |
|
} |
} |
|
|
/* |
/* |