Skip to content

Commit

Permalink
[fizzed#15] Writing data on closed socket causes unnecessary exception
Browse files Browse the repository at this point in the history
  • Loading branch information
kornefalk committed Oct 5, 2017
1 parent 55713b3 commit 1fdc96c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,11 @@ public WindowFuture<Integer,PduRequest,PduResponse> sendRequestPdu(PduRequest pd
}
}

if (!this.channel.isOpen()) {
logger.info("Channel closed.");
return future;
}

// write the pdu out & wait timeout amount of time
ChannelFuture channelFuture = this.channel.writeAndFlush(buffer);
if (configuration.getWriteTimeout() > 0){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,9 @@ public void serverSessionTimesOutWithNoBindRequest() throws Exception {
try {
BaseBindResp bindResponse = session0.bind(bindRequest, 200);
Assert.fail();
} catch (SmppChannelException e) {
} catch (SmppTimeoutException e) {
// correct behavior
logger.debug("Got expected timeout exception {}", e.getMessage());
}

// verify everything after the session timed out
Expand Down

0 comments on commit 1fdc96c

Please sign in to comment.