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

^C shall not try to recv() a new packet #6

Closed
nbareil opened this issue Sep 1, 2011 · 1 comment
Closed

^C shall not try to recv() a new packet #6

nbareil opened this issue Sep 1, 2011 · 1 comment
Assignees
Labels

Comments

@nbareil
Copy link
Owner

nbareil commented Sep 1, 2011

On ^C, term_received is set to 1 in signal handler. SIGINT has the SA_RESTART flag enabled, that way, syscalls are automatically restarted. Which means that the termination will occured only at the next packet loop entry. On low-traffic network, next packet can arrive after several seconds.

Options available:

  • Do not set SA_RESTART flag
  • Replace the whole logic with signalfd()

The latter is the best option but will require a careful rewrite of the main loop.

@ghost ghost assigned nbareil Sep 1, 2011
@nbareil nbareil closed this as completed Nov 14, 2011
@nbareil
Copy link
Owner Author

nbareil commented Nov 14, 2011

Fixed in 7e0f5ba

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

No branches or pull requests

1 participant