function for fast check on non-blocking sockets