c socket: recv and send data simultaneously
问题 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 exactly should i be sending (chat message to another client) and receiving (chat message from another client) at the same time? What's happening is that i'm always sending data and never reading. Do i need to fork and have one read and the other send? here is the relevant code client side while(1) { fd_set rfds, wfds; FD_ZERO(&rfds)