Day 50

Today, I spent finishing up the last features of my project. In particular, I had the guessing game to tackle. After a little while of no luck with my approach from yesterday, I came up with a better solution.

Instead of maintaining a constant connection, I opted to create a POST form that sends all relevant information about the game being played—namely, the guessed number, the answer, and the remaining number of guesses. It required some reworking, but it ended up working like a charm. Admittedly, it’s not the most elegant solution, as users can potentially access the answer by using the inspect feature on the browser. However, due to time constraints, it will suffice for my initial implementation. I aim to revisit and refine my last approach later on to integrate it back into my system.

The remainder of the day was dedicated to getting the ping feature to work, demonstrating that my server functions effectively with a thread pool. Surprisingly, it didn’t take as long as I had anticipated. All I had to do was utilize my handleClient method with a Java thread-pooling tool. Then, I set up a simple ping command that sleeps for 1 second and prints the time in milliseconds. It required some tinkering, but I managed to get it working just fine. I now feel fully prepared for my IPM tomorrow!