4 ms·
If you really want to understand the fundamentals, look into writing a toy HTTP server from scratching starting with sockets. The language you choose to do this
by lastofus 8y ago
If you really want to understand the fundamentals, look into writing a toy HTTP server from scratching starting with sockets. The language you choose to do this in doesn't matter quite as much, but bonus points if you use C and the POSIX API directly.
Once you have accepted a connection, you then have to decide how to handle multiple concurrent connections. Do you use threads? Sub-processes? select/poll?
You can then move on to reading/writing to shared state. Do you use memory? Files on disk? A SQL DB? If using threads/processes, is concurrent access to those resources done safely?
It's a long journey to do the above well. I highly recommend anything/everything by W. Richard Stevens https://en.wikipedia.org/wiki/W._Richard_Stevens https://en.wikipedia.org/wiki/W._Richard_Stevens