transport: add waiting state argument to Wait method