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

Avoid BindException after restart #710

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

lovebing
Copy link
Contributor

Sometimes server start failed after restart, like:
#687
#698
Some developers don't know how to solve this problem, so I think this is a good idea to set the default value of SocketConfig.reuseAddress to true. It can avoid the BindException.

Copy link

@cs6402 cs6402 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@recon88
Copy link

recon88 commented Dec 29, 2019

You can change the field through the available public method in SocketConfig (See Wiki).

Configuration configuration = new Configuration();
SocketConfig socketConfig = configuration.getSocketConfig();
socketConfig.setReuseAddress(true);

That's all you need

@kylooh
Copy link

kylooh commented Apr 9, 2020

You can change the field through the available public method in SocketConfig (See Wiki).

Configuration configuration = new Configuration();
SocketConfig socketConfig = configuration.getSocketConfig();
socketConfig.setReuseAddress(true);

That's all you need

TRIED, BUT NOT WORK

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

Successfully merging this pull request may close these issues.

None yet

4 participants