We are trying to register a action callback with xml configuration.
While trying the dp.read(); getting the IO exception : Broken pipe (Write failed)
During this time any cli action throws application communication failure
Here is the log
localhost java.net.SocketException: Broken pipe (Write failed)
localhost at java.net.SocketOutputStream.socketWrite0(Native Method)
localhost at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
localhost at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
localhost at com.tailf.proto.ConfOutputStream.writeTo(ConfOutputStream.java:174)
localhost at com.tailf.conf.ConfInternal.termWrite(ConfInternal.java:926)
localhost at com.tailf.conf.ConfInternal.termWrite(ConfInternal.java:1053)
localhost at com.tailf.dp.Dp.replyError(Dp.java:2872)
localhost at com.tailf.dp.Dp.replyError(Dp.java:2855)
localhost at com.tailf.dp.Dp.read(Dp.java:2711)
Here is the sample of the code - similar to api.
To register a data callback in ConfD, we can do:
// int port = Conf.PORT for ConfD or Conf.NCS_PORT for NCS
Socket ctrl_socket= new Socket(“127.0.0.1”, port);
final Dp dp = new Dp(“server_daemon”, ctrl_socket);
dp.registerAnnotatedCallbacks(new SimpleTransCb());
dp.registerAnnotatedCallbacks(new SimpleDataCb());
dp.registerDone();
Thread dpTh = new Thread(new Runnable() {
public void run() {
try {
while (true) dp.read();
} catch (Exception e) {
e.printStackTrace();
return;
}
}
});
dpTh.start();
The code is stable and working so far . We are getting this error for first time.
Any input is really helpful to analysis the code further