if (sendReceiveLinks == null) {
return null;
}
try {
// send empty message to kick a session
Link sendLink = sendReceiveLinks.getSendLink();
LinkMessage emptyMsg = LinkMessage.newStringMessage("");
sendLink.send(emptyMsg);
requestProtocol.requestService(serviceID);
SystemServiceConnectionLinks connectionLinks =
requestProtocol.getSystemServiceConnectionLinks();
if (connectionLinks != null) {
return new SystemServiceConnectionImpl(connectionLinks);
} else {
return null;
}
} catch (ClosedLinkException e) {
sendReceiveLinks.close();
sendReceiveLinks = null;
return null;
} catch (InterruptedIOException e) {
sendReceiveLinks.close();
sendReceiveLinks = null;
return null;
} catch (IOException e) {
sendReceiveLinks.close();
sendReceiveLinks = null;
return null;
} catch (IllegalStateException e) {
sendReceiveLinks.close();
sendReceiveLinks = null;
return null;
}