I'm having issues with my client side implementation of client server chat program where multiple clients connect. The issue is that i'm coming across is that how do i let the client know its okay to type something in? Currently, my printf statement is not being outputted to the screen. Is there a way i can notify the client that it's okay to type without using a new line?
here is the relevant code
client side
while(1) {
printf(">"); //this isn't being outputted
fd_set rfds;
FD_ZERO(&rfds);
FD_SET(serverSocket, &rfds);
FD_SET(0, &rfds);
if(select(serverSocket+1, &rfds, NULL, NULL, NULL) < 0) {
perror("select");
exit(-1);
}
if (FD_ISSET(serverSocket, &rfds)) {
//recv data from server
}
else if (FD_ISSET(0, &rfds)) {
//read keyboard
}
}