Start separate goroutine for multiplexed stream handling
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
87fdb7a30a
commit
1cbc2f86fa
18
socket.go
18
socket.go
@ -94,14 +94,18 @@ func startSocket(ctx context.Context, dev *infinitime.Device) error {
|
|||||||
log.Fatal().Err(err).Msg("Error creating multiplexed session")
|
log.Fatal().Err(err).Msg("Error creating multiplexed session")
|
||||||
}
|
}
|
||||||
|
|
||||||
for {
|
go func() {
|
||||||
conn, err := sess.Accept()
|
for {
|
||||||
if err != nil {
|
conn, err := sess.Accept()
|
||||||
log.Fatal().Err(err).Msg("Error accepting stream")
|
if errors.Is(err, io.EOF) {
|
||||||
}
|
break
|
||||||
|
} else if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error accepting stream")
|
||||||
|
}
|
||||||
|
|
||||||
go srv.ServeOne(ctx, conn)
|
go srv.ServeOne(ctx, conn)
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user