Open murugesan76 opened 8 years ago
Problematic, it's indeed a blocking call here. The only solution I can come up with is to add timeout support to receiveNotification and have a single thread loop through all devices with a timeout. Far from great but workable.
I did some googling here for you, i.e http://www.scriptscoop.net/t/f34a91700f3e/java-nio-socketchannel-client-to-multiple-servers.html Read for example the boring comment: "... Use JSch or Ganymed SSH or one of the other SSH libraries, threads, and get on with your life."
So - please go ahead - and try to add timeout support.
Thanks
/klacke
Thanks for your response klacke
If you had found a solution, please elaborate for the benefit of the forum.
The link is not working. Any alternate? http://www.scriptscoop.net/t/f34a91700f3e/java-nio-socketchannel-client-to-multiple-servers.html
Problematic, it's indeed a blocking call here. The only solution I can come up with is to add timeout support to receiveNotification and have a single thread loop through all devices with a timeout. Far from great but workable.
I did some googling here for you, i.e http://www.scriptscoop.net/t/f34a91700f3e/java-nio-socketchannel-client-to-multiple-servers.html Read for example the boring comment: "... Use JSch or Ganymed SSH or one of the other SSH libraries, threads, and get on with your life."
So - please go ahead - and try to add timeout support.
Thanks
/klacke
The receiveNotification() method in NetconfSession.java is to receive notification from one device using the NetconfSession. The thread which executes this method will be blocked till the notification is received from the device. So I need a separate thread for each device to receive the notification from them. I cannot afford to have one dedicated thread for each device. I would like to receive notification from multiple devices and those notifications from multiple devices should be handled by a single thread instead of one thread per device. Please let me know how to achieve this use case.