From 669dd64d20d7af4acb328eab8a1598a271138f04 Mon Sep 17 00:00:00 2001 From: Lorenz Leutgeb Date: Tue, 15 Sep 2015 09:35:23 +0200 Subject: [PATCH] Specify arguments to P(i|o)ngHandler Previously, the parameters to the ping and pong handlers were not documented. They are the payload of the ping and pong messages respectively. In the RFC this is referred to as "Application data". See: https://tools.ietf.org/html/rfc6455#section-5.5.2 https://tools.ietf.org/html/rfc6455#section-5.5.3 --- conn.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conn.go b/conn.go index a2374a8..dd41b98 100644 --- a/conn.go +++ b/conn.go @@ -789,6 +789,7 @@ func (c *Conn) SetReadLimit(limit int64) { } // SetPingHandler sets the handler for ping messages received from the peer. +// It's argument is the payload or "Application data" of that very message. // The default ping handler sends a pong to the peer. func (c *Conn) SetPingHandler(h func(string) error) { if h == nil { @@ -801,6 +802,7 @@ func (c *Conn) SetPingHandler(h func(string) error) { } // SetPongHandler sets the handler for pong messages received from the peer. +// It's argument is the payload or "Application data" of that very message. // The default pong handler does nothing. func (c *Conn) SetPongHandler(h func(string) error) { if h == nil {