mirror of
https://github.com/yudai/gotty.git
synced 2026-01-19 07:46:10 +01:00
Shutdown server gracefully with Ctrl-C
This commit is contained in:
parent
94a6230355
commit
e613b29cc3
3 changed files with 45 additions and 2 deletions
|
|
@ -61,7 +61,10 @@ func (context *clientContext) goHandleClient() {
|
|||
context.processReceive()
|
||||
}()
|
||||
|
||||
context.app.server.StartRoutine()
|
||||
go func() {
|
||||
defer context.app.server.FinishRoutine()
|
||||
|
||||
<-exit
|
||||
context.pty.Close()
|
||||
context.command.Wait()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue