mirror of
https://github.com/yudai/gotty.git
synced 2026-02-11 19:04:21 +01:00
Close listener after calling StartRoutine()
This change prevents the listener from closing itself before establishing the websocket session with the client.
This commit is contained in:
parent
6d1a19b1d5
commit
d4475579ff
2 changed files with 6 additions and 9 deletions
|
|
@ -62,6 +62,12 @@ func (context *clientContext) goHandleClient() {
|
|||
}()
|
||||
|
||||
context.app.server.StartRoutine()
|
||||
|
||||
if context.app.options.Once {
|
||||
log.Printf("Last client accepted, closing the listener.")
|
||||
context.app.server.Close()
|
||||
}
|
||||
|
||||
go func() {
|
||||
defer context.app.server.FinishRoutine()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue