diff --git a/README.md b/README.md index 9223326e47240fa70b0bb4bd11923e7e9cd698a3..cb5eb7a36d9983107846f81d1a52f1e00f7a148e 100644 --- a/README.md +++ b/README.md @@ -128,9 +128,9 @@ your application doesn't always need to read from the connection unless it expec gorilla/websocket requires you to constantly read from the connection to respond to control frames even if you don't expect the peer to send any messages. -The ping API is also much nicer. Unlike gorilla/websocket, you don't need to register a -callback for pongs. There is Ping method on the Conn that sends a ping and waits for the pong. -Callbacks tend to encourage awkward control flow. +The ping API is also much nicer. gorilla/websocket requires registering a pong handler on the Conn +which results in an awkward control flow. With nhooyr/websocket you use the Ping method on +the Conn that sends a ping and also waits for the pong. In terms of performance, the differences depend on your application code. nhooyr/websocket reuses buffers efficiently out of the box if you use the wsjson and wspb subpackages whereas