handle non-blocking file descriptors for both read and write. Add a