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

use poll() instead of select() when possible #705

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

Conversation

2128506
Copy link

@2128506 2128506 commented Jul 3, 2023

Currently libmodbus uses select() on Linux. If socket handle is greater than FD_SETSIZE select call causes application crash due to buffer overflow. Proposed pull request uses poll() instead of select() when available as well as fails attempts to call select on sockets >= FD_SETSIZE with EBADF.
Situation with socket handle being greater that FD_SETSIZE is not uncommon for applications that keeps hundreds of connections.

…instead of crashing app if socket handle is greater than FD_SETSIZE
@cla-bot
Copy link

cla-bot bot commented Jul 3, 2023

We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient...

@cla-bot
Copy link

cla-bot bot commented Jul 3, 2023

We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient...

@dawagner
Copy link

Related to/fixes #583.

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

2 participants