code: func (c *rawConnection) pingReceiver() error {
  	ticker := time.NewTicker(ReceiveTimeout / 2)
  	defer ticker.Stop()
  
  	for {
  		select {
  		case <-ticker.C:
  			d := time.Since(c.cr.Last())
  			if d > ReceiveTimeout {
  				l.Debugln(c.id, "ping timeout", d)
  				return ErrTimeout
  			}
  
  			l.Debugln(c.id, "last read within", d)
  
  		case <-c.closed:
  			return ErrClosed
  		}
  	}
  }
docs: // The pingReceiver checks that we've received a message (any message will do,
  // but we expect pings in the absence of other messages) within the last
  // ReceiveTimeout. If not, we close the connection with an ErrTimeout.