Hi,
The code snippet at the bottom works perfectly when the connection parametes such as name of the ads server, the port and Dacs-User-Id is correct.
But as soon as I change the Dacs-User-Id to a an incorrect one, the call to dispatch hangs and if there has been a successful connection prior to connection that makes the code to hang, the successful connection is destroyed and not events(updates) are dispatched from the existing successful connection. So in simple words submitting a connection with erroneous parameters will cause the program to hang and if the Dispatchable.INFINITE_WAIT is changed to 2000 milliseconds then it will return but as the result the call directoryClient.getServices() returns no services and worst of all the perviously successful RSSL-Connections gets corrupted in the same instance of the the app.
I have somehow the same setup for SSL code ( slightly different though ) below which works perfectly if when trying to connect and having a wrong parameter like DACS-User-Id. This means that eventually an exception is thrown and the code would never hang. Also perviously created and existing SSL Connections do not get corrupted and the clients that have registered their interest would easily re-register new insterests and work as expected.
Anyone who could shed some light on this issue? Would appreciated your expreties and help. Many thanks in advance.
In both cases(SSL and RSSL) the session has been creaed using
session = Session.acquire(connectionParameters); and also session.createEventSource(..... ) has been created to get a consumer.
try { eventGroup.dispatch(EventQueue.INFINITE_WAIT); } catch (Exception e) { logger.error("Error on listener thread. Error dispatching Event group.", e); }
========
RSSL Version
========
try {
request.setMsgType(OMMMsg.MsgType.STREAMING_REQ); request.setMsgModelType(RDMMsgTypes.DIRECTORY); OMMAttribInfo attribInfo = pool.acquireAttribInfo(); attribInfo.setFilter( RDMService.Filter.INFO | RDMService.Filter.STATE | RDMService.Filter.GROUP ); request.setAttribInfo(attribInfo);
OMMItemIntSpec spec = new OMMItemIntSpec(); spec.setMsg(request);
EventQueue eventQueue = EventQueue.create("directoryQueue"); directoryHandle = ommConsumer.registerClient(eventQueue, spec, directoryClient, null); eventQueue.dispatch(Dispatchable.INFINITE_WAIT);
} catch (Exception e) {
//Handling the exception
}
List<RMDSService> services = directoryClient.getServices();
for(RMDSService service : services) {
availableServices.put(service.getName(), service);
}
return services;