Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

SmppSession#isBound returns true even when the channel closed #93

Open
krasa opened this issue Apr 18, 2015 · 2 comments
Open

SmppSession#isBound returns true even when the channel closed #93

krasa opened this issue Apr 18, 2015 · 2 comments

Comments

@krasa
Copy link
Contributor

krasa commented Apr 18, 2015

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

@jjlauer
Copy link
Contributor

jjlauer commented Apr 18, 2015

Looks like a good find. Do you think you could produce a unit test & fix in a PR?

@krasa
Copy link
Contributor Author

krasa commented Apr 18, 2015

yeah, sure.

krasa added a commit to krasa/cloudhopper-smpp that referenced this issue Apr 18, 2015
krasa added a commit to krasa/cloudhopper-smpp that referenced this issue Apr 18, 2015
krasa added a commit to krasa/cloudhopper-smpp that referenced this issue Apr 18, 2015
krasa added a commit to krasa/cloudhopper-smpp that referenced this issue May 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants