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

How to use create a HttpServer and destory it. #687

Open
Forever1Love opened this issue Nov 16, 2020 · 3 comments
Open

How to use create a HttpServer and destory it. #687

Forever1Love opened this issue Nov 16, 2020 · 3 comments

Comments

@Forever1Love
Copy link

hello,I am a learner of the AndroidAsync, I want to create a HttpServer on a activity ,while the activity is finished, the httpServer shoud be destoryed , I tried it , but When the activity is finished, the httpServer is alive , I can browse the url through my browse.
activity
the class extends  AsyncHttpServer

@chenzuohua918
Copy link

I meat this problem too!

@chenzuohua918
Copy link

I fix it by this:
AsyncServer mAsyncServer = AsyncServer.getDefault();
AsyncHttpServer mServer = new AsyncHttpServer();

 public void start() {
        mServer.listen(mAsyncServer, port);
 }

 public void stop() {
        mServer.stop();
        mAsyncServer.stop();
 }

@Forever1Love
Copy link
Author

Forever1Love commented Dec 15, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants