C, socket programming: Connecting multiple clients to server using select()

后端 未结 5 1937
有刺的猬
有刺的猬 2021-02-02 00:23

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         


        
5条回答
  •  清酒与你
    2021-02-02 01:02

    In the while loop for the server, change the code to do recv(i) instead of recv(clientsocks[i]). I have implemented this code and it works with this change.

提交回复
热议问题