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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user