Makes shutdown flag volatile
Implements a nio nonblocking asynchronous server/client

This is a single threaded implementation which switches between all connected channels
changing modes depending on the current operation