I wanted to know just what exactly happens or how on earth does a "server" even work or how would it even "understand" http requests
and how http requests/responses work. It started with this heavily abstracted java server-client program
that taught me simple socket programming and how its like a literal two pin plug.
- I literally had to relearn what passing by value and passing by reference meant which is why pointers exist
- Pointers are literally so much fun especially when it comes to figuring out how to free memory in a callee function from a pointer that was allocated memory in a called function
- RTFM has never worked so well until now, there was a point where I got the server to essentially serve it's purpose but it kept on reading from the socket even after the socket was
closed. Only after reading through this doc that I learnt that
shutdown()
was a much better way of handling closing a socket thanclose()
when using a TCP connection that ensures that data is sent. - I oddly get motivated while building stuff that many people have deemed not needed to understand to learn programming.
While learning Harvard's CS50 there was a time when the week's topic was on HTML, CSS and Javascript where we could just use a http-server command that lets us get a simple static web server up and running in literally no time but I was much more intrigued with how on earth does "http-server" work than I was building the week's project.
- tidy up the readme
- add some drawings
- video ???