private BindRequest waitForBind(long timeout) throws IllegalStateException, TimeoutException {
  SessionState currentSessionState=getSessionState();
  if (currentSessionState.equals(SessionState.OPEN)) {
    try {
      return bindRequestReceiver.waitForRequest(timeout);
    }
 catch (    IllegalStateException e) {
      throw new IllegalStateException("Invocation of waitForBind() has been made",e);
    }
catch (    TimeoutException e) {
      close();
      throw e;
    }
  }
 else {
    throw new IllegalStateException("waitForBind() should be invoked on OPEN state, actual state is " + currentSessionState);
  }
}

private BindRequest waitForBind ( long timeout ) throws IllegalStateException , TimeoutException { SessionState currentSessionState = getSessionState ( ) ; if ( currentSessionState . equals ( SessionState . OPEN ) ) { try { return bindRequestReceiver . waitForRequest ( timeout ) ; } catch ( IllegalStateException e ) { throw new IllegalStateException ( "Invocation of waitForBind() has been made" , e ) ; } catch ( TimeoutException e ) { close ( ) ; throw e ; } } else { throw new IllegalStateException ( "waitForBind() should be invoked on OPEN state, actual state is " + currentSessionState ) ; } }
wait for bind request .
