X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fnetconf-netty-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fnettyutil%2FAbstractNetconfSessionNegotiator.java;h=59f3e450b9c35b5d137bc391531a9c7a6ee28bf7;hb=44d23b752c46b110188ebc9371a0d459c408bebc;hp=89c0be106837c21a907587dedca8dcb491b20a39;hpb=d9cf4638bbf31af7380656a326fc7c51007ce13c;p=netconf.git diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java index 89c0be1068..59f3e450b9 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java @@ -336,11 +336,12 @@ public abstract class AbstractNetconfSessionNegotiator { - if (!f.isSuccess()) { - LOG.info("Failed to send message {} on channel {}", msg, channel, f.cause()); - negotiationFailed(f.cause()); + protected void sendMessage(final NetconfMessage msg) { + channel.writeAndFlush(msg).addListener(f -> { + final var cause = f.cause(); + if (cause != null) { + LOG.info("Failed to send message {} on channel {}", msg, channel, cause); + negotiationFailed(cause); } else { LOG.trace("Message {} sent to socket on channel {}", msg, channel); }