This class is a runnable that is using Java nio's
Selector to listen for incoming messages on multiple connections in a single thread, then spawn a runnable in a
CachedThreadPool to actually read the message and dispatch it to the connection's subscriber.
It's planned in the future to look for a library/implementation more stable and cleaner of this. This implementation works, but might not be optimal and contains unknown bugs.
I first tried to use netty, but it seems really complicate to implement, even to do basic stuff.
Updated less than a minute ago