So I'm trying to learn how to use the network package by making a simple chat program. The issue I'm having is using the socket selector. I followed the example given exactly, with some added cout's to see whats going on inside of it in the console. The issue I'm having is the server will act as expected, it gets to the if( selector.wait() ) part and the function blocks like it is suppose to. I know this because I have a text output right before that line and it is inside an infinite loop. However, once the first client connects to the server, the selector.wait() function fails to block. I know this because the server console window gets spammed with my message. It also never receives anything from the clients because I have an output on the server such that no matter what happens inside the if something will get pasted to the console screen.
There must be something I'm missing. I can't find it.
I'm running the test by connecting to local host if that matters.
Any help would be greatly appreciated.