Skip to content

SetDeadline should only close the connection if there is an in progress Read/Write #228

Closed
@emersion

Description

@emersion

I'm using websocket.NetConn. net.Conn docs say:

A deadline is an absolute time after which I/O operations fail with a timeout (see type Error) instead of blocking.

However this closes the connection 10s after the write, even if the write has already completed:

conn.SetWriteDeadline(time.Now().Add(10 * time.Second)
conn.Write([]byte("hello world"))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions