xk6-websockets icon indicating copy to clipboard operation
xk6-websockets copied to clipboard

Don't call `conn.Close` on the event loop

Open mstoykov opened this issue 1 year ago • 0 comments

From https://github.com/grafana/xk6-websockets/pull/44#discussion_r1169706247

While I did look into this a while back and was left with the impression it is fine due to the doc

Close closes the underlying network connection without sending or waiting for a close message.

This still calls net.Conn#Close which likely while much faster then most other calls will be a blocking one.

I doubt this is as big of a problem as if we were writing messages, but it still better if we do not.

We also do it in a bunch more places so this is not the only place that needs fixing.

mstoykov avatar Apr 19 '23 09:04 mstoykov