implementation of non-blocking TCP server