-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
socket-utils: Ensure child processes are terminated upon socket close
Addresses issue #7. Added some rudimentary PID to FD tracking so that when we close a file descriptor opened by `open_serial_socket()`, the process behind that socket (if any) is explicitly terminated. This unfortunately requires us to add a new function called `close_serial_socket()`, but in this particular case the change was not onerous. We are only handling five such sockets for now. If there are ever more than that many system sockets opened through this mechanism, then something is likely seriously wrong. The socket tracking code is super simple and possibly not thread safe, which is fine in this case since these methods will only ever be called from the same thread. I really wish these sorts of antics were not necessary, but all other methods of handling this sort of thing seem to come up short.
- Loading branch information
1 parent
c9b9223
commit 5aafbd5
Showing
5 changed files
with
139 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters