func (c *_Conn) onUnsubscribe(unsubMsg utp.Unsubscribe, sub *utp.Subscription) *types.Error {
	start := time.Now()
	defer log.ErrLogger.Debug().Str("context", "conn.onUnsubscribe").Int64("duration", time.Since(start).Nanoseconds()).Msg("")

	//Parse the key
	topic := security.ParseKey(sub.Topic)
	if topic.TopicType == security.TopicInvalid {
		return types.ErrBadRequest
	}

	if !c.insecure {
		if _, err := c.onSecureRequest(topic); err != nil {
			return err
		}
	}

	if err := c.unsubscribe(unsubMsg, topic); err != nil {
		return types.ErrServerError
	}

	return nil
}
// onUnsubscribe is a handler for Unsubscribe events.
onUnsubscribe is a handler for Unsubscribe events.
// onUnsubscribe is a handler for Unsubscribe events .
func (c *_Conn) onUnsubscribe(unsubMsg utp.Unsubscribe, sub *utp.Subscription) *types.Error {
	start := time.Now()
	defer log.ErrLogger.Debug().Str("context", "conn.onUnsubscribe").Int64("duration", time.Since(start).Nanoseconds()).Msg("")
	topic := security.ParseKey(sub.Topic)
	if topic.TopicType == security.TopicInvalid {
		return types.ErrBadRequest
	}
	if !c.insecure {
		if _, err := c.onSecureRequest(topic); err != nil {
			return err
		}
	}
	if err := c.unsubscribe(unsubMsg, topic); err != nil {
		return types.ErrServerError
	}
	return nil
}
func ( c * _Conn ) onUnsubscribe ( unsubMsg utp . Unsubscribe , sub * utp . Subscription ) * types . Error { start := time . Now ( ) defer log . ErrLogger . Debug ( ) . Str ( " " , " " ) . Int64 ( " " , time . Since ( start ) . Nanoseconds ( ) ) . Msg ( " " ) topic := security . ParseKey ( sub . Topic ) if topic . TopicType == security . TopicInvalid { return types . ErrBadRequest } if ! c . insecure { if _ , err := c . onSecureRequest ( topic ) ; err != nil { return err } } if err := c . unsubscribe ( unsubMsg , topic ) ; err != nil { return types . ErrServerError } return nil }
onUnsubscribe is a handler for Unsubscribe events.
onUnsubscribe is a handler for Unsubscribe events .
//Parse the key