This method blocks until certain conditions hold true on the underlying SSH-2 channel.
This method returns as soon as one of the following happens:
- at least of the specified conditions (see {@link ChannelCondition}) holds true
- timeout > 0 and a timeout occured (TIMEOUT will be set in result conditions)
- the underlying channel was closed (CLOSED will be set in result conditions)
In any case, the result value contains ALL current conditions, which may be more than the specified condition set (i.e., never use the "==" operator to test for conditions in the bitmask, see also comments in {@link ChannelCondition}).
Note: do NOT call this method if you want to wait for STDOUT_DATA or STDERR_DATA and there are concurrent threads (e.g., StreamGobblers) that operate on either of the two InputStreams of this Session
(otherwise this method may block, even though more data is available in the StreamGobblers).
@param condition_set a bitmask based on {@link ChannelCondition} values
@param timeout non-negative timeout in ms, 0
means no timeout
@return all bitmask specifying all current conditions that are true