libnetconf2 icon indicating copy to clipboard operation
libnetconf2 copied to clipboard

Query: Detecting socket errror/closed in netconf session

Open shishirpandey29 opened this issue 6 years ago • 3 comments

Hi, I am using libnetconf2 to implement netconf client . my requirement is:

  1. detecting socket error/closed in netconf session
  2. try to create new netconf session is there any API to check socket error/closed in netconf session?

shishirpandey29 avatar Mar 24 '19 03:03 shishirpandey29

Hi,

  1. There is no API but these situations should be detected using keep-alive packets that are enabled by default.
  2. There are a few functions for that but you probably want nc_connect_ssh().

Regards, Michal

michalvasko avatar Mar 24 '19 08:03 michalvasko

keep-alive options has been opened by default?

ZhaoGuangYue1986 avatar Mar 25 '19 11:03 ZhaoGuangYue1986

Hi, yeah, it should be if you use a fairly recent version of libnetconf2.

Regards, Michal

michalvasko avatar Mar 26 '19 08:03 michalvasko