more cruft for select, made the port non-blocking. Will remove the thread part later in the call