Skip to content

Commit 292fd08

Browse files
authored
Replace "frame" with "message" in documentation
The documentation sometimes used the term "frame" when referring to single frame control messages. Use the term "message" for consistency in the documentation and to hide a detail that most application programmers do not need to know about.
1 parent 58729a2 commit 292fd08

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

conn.go

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (e *netError) Error() string { return e.msg }
100100
func (e *netError) Temporary() bool { return e.temporary }
101101
func (e *netError) Timeout() bool { return e.timeout }
102102

103-
// CloseError represents close frame.
103+
// CloseError represents a close message.
104104
type CloseError struct {
105105
// Code is defined in RFC 6455, section 11.7.
106106
Code int
@@ -342,7 +342,8 @@ func (c *Conn) Subprotocol() string {
342342
return c.subprotocol
343343
}
344344

345-
// Close closes the underlying network connection without sending or waiting for a close frame.
345+
// Close closes the underlying network connection without sending or waiting
346+
// for a close message.
346347
func (c *Conn) Close() error {
347348
return c.conn.Close()
348349
}
@@ -1034,7 +1035,7 @@ func (c *Conn) SetReadDeadline(t time.Time) error {
10341035
}
10351036

10361037
// SetReadLimit sets the maximum size for a message read from the peer. If a
1037-
// message exceeds the limit, the connection sends a close frame to the peer
1038+
// message exceeds the limit, the connection sends a close message to the peer
10381039
// and returns ErrReadLimit to the application.
10391040
func (c *Conn) SetReadLimit(limit int64) {
10401041
c.readLimit = limit
@@ -1047,16 +1048,16 @@ func (c *Conn) CloseHandler() func(code int, text string) error {
10471048

10481049
// SetCloseHandler sets the handler for close messages received from the peer.
10491050
// The code argument to h is the received close code or CloseNoStatusReceived
1050-
// if the close message is empty. The default close handler sends a close frame
1051-
// back to the peer.
1051+
// if the close message is empty. The default close handler sends a close
1052+
// message back to the peer.
10521053
//
10531054
// The application must read the connection to process close messages as
1054-
// described in the section on Control Frames above.
1055+
// described in the section on Control Messages above.
10551056
//
1056-
// The connection read methods return a CloseError when a close frame is
1057+
// The connection read methods return a CloseError when a close message is
10571058
// received. Most applications should handle close messages as part of their
10581059
// normal error handling. Applications should only set a close handler when the
1059-
// application must perform some action before sending a close frame back to
1060+
// application must perform some action before sending a close message back to
10601061
// the peer.
10611062
func (c *Conn) SetCloseHandler(h func(code int, text string) error) {
10621063
if h == nil {
@@ -1075,11 +1076,11 @@ func (c *Conn) PingHandler() func(appData string) error {
10751076
}
10761077

10771078
// SetPingHandler sets the handler for ping messages received from the peer.
1078-
// The appData argument to h is the PING frame application data. The default
1079+
// The appData argument to h is the PING message application data. The default
10791080
// ping handler sends a pong to the peer.
10801081
//
10811082
// The application must read the connection to process ping messages as
1082-
// described in the section on Control Frames above.
1083+
// described in the section on Control Messages above.
10831084
func (c *Conn) SetPingHandler(h func(appData string) error) {
10841085
if h == nil {
10851086
h = func(message string) error {
@@ -1101,11 +1102,11 @@ func (c *Conn) PongHandler() func(appData string) error {
11011102
}
11021103

11031104
// SetPongHandler sets the handler for pong messages received from the peer.
1104-
// The appData argument to h is the PONG frame application data. The default
1105+
// The appData argument to h is the PONG message application data. The default
11051106
// pong handler does nothing.
11061107
//
11071108
// The application must read the connection to process ping messages as
1108-
// described in the section on Control Frames above.
1109+
// described in the section on Control Messages above.
11091110
func (c *Conn) SetPongHandler(h func(appData string) error) {
11101111
if h == nil {
11111112
h = func(string) error { return nil }

0 commit comments

Comments
 (0)