long poll with timeout