Proxy server

zhaozj2021-02-16  68

IoCP is using IOCP to modify a previously written proxy server program.

Now that the problem of controlling the number of users is basically resolved, the event is used to solve this é. First create a list of global user configuration, create a monitoring thread waiting for this event. Read the maximum number of connections in the configuration file, the highest bandwidth data per connected, and this list saves a list of current active connections and connected to the waiting state. When there is a new connection, it is determined whether to reach the maximum number of connections, otherwise Direct delivery of WSARECV, then add this link to the waiting connection list. When a connection transfer is completed, set the connection to complete the event, and the monitoring thread gets a connection from the list and delivers a WSARECV. This can achieve the number of control connections but not directly to the maximum number of connections, and solve IE because it does not normally browse problems normally because of the disconnect connection.

But about bandwidth restriction issues are still not fully resolved, consider using the TimeSetEventTIEM or CreateTimeQueEuetimer delay to deliver WSARECV or WSasend.

转载请注明原文地址:https://www.9cbs.com/read-14765.html

New Post(0)