I am trying to build a simple web server with just c++11 and those socket libraries.
I think there are two options for me: poll() and multi-thread with blocking recv().(Let me know if you know other options)
- poll() can be just single thread. But the while loop can be quite messy. But you won't encounter a lot of thread-related problem.
- So I tried multi-thread with blocking recv() and set recvtimeo. It looks not bad. But I am just curious will this method cost more resources?
Aucun commentaire:
Enregistrer un commentaire