I am working on a high traffic network network that uses Tcp sockets. I think I need 3 threads for this system.
- Basic Tcp listening: select () based on I / O
- In the data processing class: packets are processed, choosing sockets for sending output data (for games / char systems, etc.).
- Data Processing Class:. I will send data with the send () method, which is a lock method, so I need to implement a (while / for) loop, and this loop will take some time, and I will not slow down the data processing, I will implement this data processing class for the socket send loop .
Now I am going to implement such a network hierarchy, but I am sure that I must create a data processing class. Is this necessary to improve network performance? Otherwise, any other suggestion for improving network performance? (maybe I don't see anything)
PLUS: I collect incoming Tcp packets to process the complete packet from the client, which is a special package, such as positioning the RPC in the game, user request, etc.
c ++ io networking sockets tcp
freaka61
source share