I\'m trying to make a server that can be connected to by multiple clients. Here\'s my code so far:
Client:
int main(int argc, char **argv) { struct so
Two issues in your code:
You should do recv(i, ...) instead of recv(clientsock[i], ...)
recv(i, ...)
recv(clientsock[i], ...)
After that you do not check if recv() failed, and therefore printf() prints out the uninitialised buffer message, hence the garbage in the output
recv()
printf()
message