From b4b5d887ad624c8886795879af90a07a5fd1f48d Mon Sep 17 00:00:00 2001 From: Gary Burd Date: Thu, 16 Dec 2021 11:07:50 -0800 Subject: [PATCH] Document the allowed concurrency on Upgrader and Dialer (#636) * Document allowed concurrency on Dialer. * Document allowed concurrency on Upgrader. --- client.go | 2 ++ server.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/client.go b/client.go index c4b62fbc..e4fc18f7 100644 --- a/client.go +++ b/client.go @@ -48,6 +48,8 @@ func NewClient(netConn net.Conn, u *url.URL, requestHeader http.Header, readBufS } // A Dialer contains options for connecting to WebSocket server. +// +// It is safe to call Dialer's methods concurrently. type Dialer struct { // NetDial specifies the dial function for creating TCP connections. If // NetDial is nil, net.Dial is used. diff --git a/server.go b/server.go index 152ebf89..406f3076 100644 --- a/server.go +++ b/server.go @@ -23,6 +23,8 @@ func (e HandshakeError) Error() string { return e.message } // Upgrader specifies parameters for upgrading an HTTP connection to a // WebSocket connection. +// +// It is safe to call Upgrader's methods concurrently. type Upgrader struct { // HandshakeTimeout specifies the duration for the handshake to complete. HandshakeTimeout time.Duration