@Override
protected boolean bind (BindRequest request, PduEventListener listener)
{
super.bind (request, listener);
BindResponse response = null;
try {
response = getSession ().bind (request);
}
catch (ValueNotSetException exc) {
myLog.error ("open - value not set", exc);
return false;
}
catch (WrongSessionStateException exc) {
myLog.error ("open - session state wrong", exc);
return false;
}
catch (TimeoutException exc) {
myLog.error ("open - timeout establishing connection", exc);
return false;
}
catch (PDUException exc) {
myLog.error ("open - exception in pdu", exc);
return false;
}
catch (IOException exc) {
myLog.error ("open - io exception (socket problem?)", exc);
return false;
}
if (response == null) {
myLog.error ("open - getSession ().bind returned null");
return false;
}
else if (response.getCommandStatus () == Data.ESME_ROK) {
return true;
}
else {
myLog.error ("open - binding failed - server response: {}", response.debugString ());
return false;
}
}