Home > other >  TCP client program design
TCP client program design

Time:10-02

Questions: how the client wants to design a TCP application, the client every 1 s (or less) to the server sends a heartbeat packets (a few KB), after you receive the server sends a response to the client, now design a program set up multiple threads to simulate the scenario, request the client 10000 ~ 25000, the server CPU usage cannot be too high,

Status: the current run 5000 threads interval of 1 s to send, program there is no problem, no packet loss, server CPU utilization at 45%
Problem: when running 10000 threads, thread part client connect error: connection reset by peer, Internet access too often is the explanation of the server shut down some socket, but does not provide a good solution to
Today did two experiments:
1. Open two processes use two port on the server to send and receive 5000 threads from the two nodes, two nodes of the client are quoted above error
2. Will request the client to send and receive time interval from 1 s to 3 s (for each round of sending and receiving end), running to 10000 threads, found that there is no problem, the program can run stable down

Consult everybody how to achieve the purpose of my great god, don't appreciate ~

CodePudding user response:

Most recently used Mina, I am a novice, but don't know if this is useful to you!
  • Related