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

Restart of server fails because of disabled reuseaddr socket option #6493

Closed
2 tasks done
keba-estr opened this issue May 23, 2024 · 3 comments
Closed
2 tasks done

Restart of server fails because of disabled reuseaddr socket option #6493

keba-estr opened this issue May 23, 2024 · 3 comments

Comments

@keba-estr
Copy link
Contributor

Description

Follow up of issue #6463

Background Information / Reproduction Steps

The provided fix with commit 00206cd does not work (at least on linux systems).
Although the function UA_EventLoopPOSIX_setReusable succeeds with UA_STATUSCODE_GOOD when closing the port,
the socket can not be opened sporadically at the next restart.
It seems that the socket option SO_REUSEADDR only has an effect if called before the function bind.

Checklist

Please provide the following information:

  • open62541 Version (release number or git tag): 1.4
  • Operating system: Linux
@jpfr
Copy link
Member

jpfr commented May 23, 2024

In that case you best option is to set the reuseaddr configuration flag for your application.

UA_Boolean tcpReuseAddr;

That way the socket is set reusable automatically.

@keba-estr
Copy link
Contributor Author

We can set the option in the server.
@jpfr: However, the security point of view about this setting should be discussed in the next community call.

@jpfr
Copy link
Member

jpfr commented May 23, 2024

Sure we can discuss.

@jpfr jpfr closed this as completed May 23, 2024
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