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

Return based exiting #99

Open
wants to merge 1 commit into
base: mainline
Choose a base branch
from
Open

Conversation

nckslvrmn
Copy link

changes:

  • Fixes to UUID calls to work with newer versions of golang
  • Flag and functions added to datachannel that define whether a session has ended and set the value of the session end flag. this is to support cleaner exiting of code.
  • All os.Exit calls have been replaced with return. This is because when using this module as a library in other codebases, it is desirable to execute other code after this module has completed. os.Exit simultaneously kills all goroutines and the main process, making it impossible to execute code after the fact. This creates some issues addressed in other changes.
  • The main function handling keyboard input for shell sessions has been modified so that the blocking loop waiting on input is now in its own goroutine. This allows the main routine to check whether the session has ended and will no longer get stuck in an infinite blocking wait. The select block is used to check whether the session has ended and returns if it has.
  • Control signals on port sessions are now being handled and trigger the session end. This required modifying the local listeners on the mux clients so that they could be accessed by other functions. This allows them to be cleanly closed when sessions have ended.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…and move human input to goroutine to unblock main routine
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.

1 participant