12-05-2017
10:01 PM
- last edited on
03-25-2019
01:19 PM
by
ciscomoderator
Notification.read is throwing end of file excption after calling syncHaNotification() in using NOTIF_HA_INFO_SYNC
without this NOTIF_HA_INFO_SYNC flag it's working fine.
Getting below exception --
Socket notifSock = new Socket("localhost", NcsMain.getInstance().getNcsPort());
EnumSet<NotificationType> notifSet = EnumSet.of(NotificationType.NOTIF_HA_INFO,
NotificationType.NOTIF_HA_INFO_SYNC);
Notif haNotif = new Notif(notifSock, notifSet);
// forever
while (shouldRun) {
Notification notif = haNotif.read();
if (notif instanceof HaNotification) {
LOG.debug(notif.toString());
handleHaNotification((HaNotification)notif);
}
}
01-05-2018 12:53 PM
You will probably need to open a ticket on this one.
-Dan
12-23-2019 07:37 AM
Any update on this? Hit the same issue on NSO 4.7.4.3
12-23-2019 12:31 PM
As per javadoc in that case need to call below method during handling of that notification.
/** * If the received event from {@link #read()} was a * {@link HaNotification} which was subscribed using the * notification type {@link NotificationType#NOTIF_HA_INFO} * in combination with {@link NotificationType#NOTIF_HA_INFO_SYNC} * it is important that we call this function or else the * user session will hang indefinitely. * * @throws IOException */ public synchronized void syncHaNotification() throws IOException {
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide