code: func (s *Socket) OnClose(f OnCloseFunc) {
  	go func() {
  		// Recover panics and log the error.
  		defer func() {
  			if e := recover(); e != nil {
  				log.L.Errorf("glue: panic while calling onClose function: %v\n%s", e, debug.Stack())
  			}
  		}()
  
  		<-s.isClosedChan
  		f()
  	}()
  }
docs: // OnClose sets the functions which is triggered if the socket connection is closed.
  // This method can be called multiple times to bind multiple functions.