cloudhopper-smpp
cloudhopper-smpp copied to clipboard
SmppSession#isBound returns true even when the channel closed
easily reproducible on both master and netty4, connect and then shutdown the server
public static void main(String[] args) throws UnrecoverablePduException, SmppChannelException, InterruptedException, SmppTimeoutException {
DefaultSmppClient clientBootstrap = new DefaultSmppClient(Executors.newCachedThreadPool());
SmppSessionConfiguration config = new SmppSessionConfiguration();
config.setWindowSize(1);
config.setHost("127.0.0.1");
config.setPort(5000);
try {
SmppSession session = clientBootstrap.bind(config,new DefaultSmppSessionHandler());
while (session.isBound()) { //always true
System.out.println("bound");
Thread.sleep(1000);
}
} finally {
System.out.println("destroying");
clientBootstrap.destroy();
}
}
Seems to me that DefaultSmppSession#fireChannelClosed should update the state
Looks like a good find. Do you think you could produce a unit test & fix in a PR?
yeah, sure.