The TCP server module, with FTP and HTTP, is more like a demo project
. It shows how you can handle many sockets without creating many tasks, by using
In a real application, I can imagine that it can be worth to use more tasks with different priorities.
if a socket work function run slowly or is blocked,
all my TCP server is affected.
It is not OK to have a working function block: all sockets should be used in a non-blocking way
. If you can not write to a socket, activate the
bit for that socket, and the work function will be called again as soon as data can be sent.