Here's a little diagram to clarify how threads are used in FlexHub. Each thread runs independently from the other threads, the Main thread starts all the threads when the hub is started, and can shut them down when needed.
Each open port has it's own serverthread because it has to wait for new connections and the thread will stop until a new connection is made.
For now the Loginthread and the Listenthread are combined into one, because they had some trouble with simultaneous access to the same data, this will be fixed after beta. This means the beta-version will use a bit more cpu because no separate timing between loginthread and listenthread is possible.
