Home > other >  Server concurrent design doubts (socket communication)
Server concurrent design doubts (socket communication)

Time:10-20

hello, I now take over a project, is doing on the server side, is there are a lot of client, the whole system through the socket to connect to the server, client programs written in python, is called a socket send many files, each 1 m or so, 4500 files, each sending a file is a socket connection, transmission, and then the end of the process, I was responsible for writing the server this, mainly in C, now is not sure how this concurrent design, because of up to 100 units in the client may, at the same time I was hoping to is according to the records of the client Mac address, distribution start corresponding to the number of threads, and operations in a thread, but design, debugging is very troublesome, then to see foreigners write textbooks say the connection-oriented concurrent server is usually a big while loop, inside the accept waiting for connection, and then to a socket and then open a thread, but in that case a client on my side even want to open up the server thread hundreds of times, feel very strange, because to do very little server, so wanted to ask the experts in this situation is how to deal with, thank you

CodePudding user response:

Baidu asynchronous socket
  • Related