Failed to connect to ConfD: Transport endpoint is already connected


when I get/write data via confd socket many times, confd ocurrs “DEBUG Failed to connect to ConfD: Transport endpoint is already connected”.

follow case is my test steps:
There is a process waiting notification from confd.
There is another shell script call “netconf-console --host ip --port prot config.xml” per 2 seconds.
When the process receives notificaton from poll set, it will do “example code”.
After shell script repeates netconf-console command more than 40 times, the process will occur “Transport endpoint is already connected” in cdb_connect function.

example code:
confd_sock = socket(PF_INET6, SOCK_STREAM, 0);
confd_load_schemas((struct sockaddr*)&addr, sizeof(struct sockaddr_in6);
cdb_connect(confd_sock, CDB_DATA_SOCKET, (struct sockaddr*)&addr, sizeof(struct sockaddr_in6));
cdb_start_session(confd_sock, CDB_OPERATIONAL);
// do something in iterate_changes function
cdb_diff_iterate(subs_sock, sub_points, iterate_changes, (ITER_WANT_PREV | ITER_WANT_SCHEMA_ORDER), (void*)&confd_sock);

what’s problem in my example code?

I do not believe there are any problems with the subset of the code you shared.