I am wring a small http server which is using the Microsoft Windows WinSock API.
Do I need to apply multithreaded logic when handling multiple users?
Currently Windows sends a message when there is a network event and each message carried (in wParam) the socket to be used in either send() or recv().
When client A connects and requests a couple of files usually a number of socket are created by Winsock. My server then get a message that "send this file to socket 123" and later "send that file to socket 456"
When another client connect it too gets a few sockets, say 789 and 654.
My server then respond to requests to send data using supplied socket number. It does not have to know who wants the file since the correct file has to be sent to the right socket.
I do not know whether Windows itself uses multiple threads when handling accepting connection and sending the message down to my program.
So my question is:
Do I need to apply multithreaded logic when handling multiple users? And if so at what point should I create a thread?