Added a timeout to the EndpointBase's poll().