connection.addObserver(messageListener);
connection.bind(getConnectionType(configuration), configuration.getSystemId(), configuration.getPassword(), configuration.getSystemType(),
getBindTON(), getBindNPI(), null);
BindResp bindResp = messageListener.getBindResponse(configuration.getBindTimeout());
if (bindResp == null || bindResp.getCommandStatus() != 0) {
// close the link if no response
if (link != null) {
try { link.close(); } catch (Exception f) {}
}
throw new Exception("Bind Response failed: " + bindResp);