Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#15] Writing data on closed socket causes unnecessary exception #19

Open
wants to merge 1 commit into
base: netty4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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