From 12aa3036f537d04ffd8d8630dc42876677100337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Kornefalk?= Date: Wed, 4 Oct 2017 09:50:31 +0200 Subject: [PATCH] [#15] Writing data on closed socket causes unnecessary exception in Netty --- .gitignore | 2 +- .../java/com/cloudhopper/smpp/impl/DefaultSmppSession.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7f275add..4f9ff8db 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ target/ .classpath .project .settings/ - +.idea/ diff --git a/src/main/java/com/cloudhopper/smpp/impl/DefaultSmppSession.java b/src/main/java/com/cloudhopper/smpp/impl/DefaultSmppSession.java index 66ff11b7..c400fda5 100644 --- a/src/main/java/com/cloudhopper/smpp/impl/DefaultSmppSession.java +++ b/src/main/java/com/cloudhopper/smpp/impl/DefaultSmppSession.java @@ -516,6 +516,11 @@ public WindowFuture sendRequestPdu(PduRequest pd } } + if (!this.channel.isOpen()) { + logger.info("Channel closed."); + return; + } + // we need to log the PDU after encoding since some things only happen // during the encoding process such as looking up the result message if (configuration.getLoggingOptions().isLogPduEnabled()) {