test read deadline
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 29s
Build and Publish / BuildAndDeploy (push) Successful in 2m34s

This commit is contained in:
matst80
2024-11-21 19:03:49 +01:00
parent 893abe9ae2
commit 256511243e

View File

@@ -162,11 +162,12 @@ func (c *Connection) Listen() (*GenericListener, error) {
} }
const ( const (
MaxCallDuration = 1500 * time.Millisecond MaxCallDuration = 2500 * time.Millisecond
) )
func (l *GenericListener) HandleConnection(conn net.Conn) { func (l *GenericListener) HandleConnection(conn net.Conn) {
ch := make(chan FrameWithPayload, 1) ch := make(chan FrameWithPayload, 1)
conn.SetReadDeadline(time.Now().Add(MaxCallDuration))
go WaitForFrame(conn, ch) go WaitForFrame(conn, ch)
select { select {
case frame := <-ch: case frame := <-ch: