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

connection fd #5

Open
thalueng opened this issue Oct 1, 2014 · 3 comments
Open

connection fd #5

thalueng opened this issue Oct 1, 2014 · 3 comments

Comments

@thalueng
Copy link

thalueng commented Oct 1, 2014

the current code for the daemon does not close the connect file descriptors (newsockfd). in an application where there are a large number of accepts to be made, the daemon eventually terminates when no more file descriptors are available. this is the case, as an example, in an application where the server would run a cron job every minute to automatically switch sockets.
fix: as you do not need the fork threads for this to work, switch the sockets in the while loop (not in a separate thread) and close newsockfd at the bottom of the while loop.
you can check whether you have a fd problem with the following commands:
ps -ax | grep daemon # daemon must be your executable file name
lsof -p # the pid you received with the previous command

@xkonni
Copy link
Owner

xkonni commented Oct 1, 2014

yes thats correct. feel free to send a pull-request, thanks!

@devzero84
Copy link
Contributor

I am working on a rework from scratch of the whole daemon. I will send a pull request when it's done. There are some more bugs (crash while receiving malformed data, no longer working delay) and (for me) missing features like binary addressing.

@xkonni
Copy link
Owner

xkonni commented Jul 16, 2015

sure, sounds nice!

still i'd recommend looking at the powerswitch branch first.

konni

July 14 2015 6:37 PM, "devzero84" wrote:
I am working on a rework from scratch of the whole daemon. I will send a pull request when it's done. There are some more bugs (crash while receiving malformed data, no longer working delay) and (for me) missing features like binary addressing.

Reply to this email directly or view it on GitHub (#5 (comment)).

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

3 participants