func (c *Client) Identify(listenerID string, pk packets.Packet, ac Auth) {
	c.Listener = listenerID
	c.AC = ac

	c.ID = pk.ClientID
	if c.ID == "" {
		c.ID = xid.New().String()
	}

	c.r.ID = c.ID + " READER"
	c.w.ID = c.ID + " WRITER"

	c.Username = pk.Username
	c.Password = pk.Password
	c.cleanSession = pk.CleanSession
	c.keepalive = pk.Keepalive

	if pk.WillFlag {
		c.LWT = LWT{
			Topic:   pk.WillTopic,
			Message: pk.WillMessage,
			Qos:     pk.WillQos,
			Retain:  pk.WillRetain,
		}
	}

	c.refreshDeadline(c.keepalive)
}
// Identify sets the identification values of a client instance.
Identify sets the identification values of a client instance.
// Identify sets the identification values of a client instance .
func (c *Client) Identify(listenerID string, pk packets.Packet, ac Auth) {
	c.Listener = listenerID
	c.AC = ac
	c.ID = pk.ClientID
	if c.ID == "" {
		c.ID = xid.New().String()
	}
	c.r.ID = c.ID + " READER"
	c.w.ID = c.ID + " WRITER"
	c.Username = pk.Username
	c.Password = pk.Password
	c.cleanSession = pk.CleanSession
	c.keepalive = pk.Keepalive
	if pk.WillFlag {
		c.LWT = LWT{
			Topic:   pk.WillTopic,
			Message: pk.WillMessage,
			Qos:     pk.WillQos,
			Retain:  pk.WillRetain,
		}
	}
	c.refreshDeadline(c.keepalive)
}
func ( c * Client ) Identify ( listenerID string , pk packets . Packet , ac Auth ) { c . Listener = listenerID c . AC = ac c . ID = pk . ClientID if c . ID == " " { c . ID = xid . New ( ) . String ( ) } c . r . ID = c . ID + " " c . w . ID = c . ID + " " c . Username = pk . Username c . Password = pk . Password c . cleanSession = pk . CleanSession c . keepalive = pk . Keepalive if pk . WillFlag { c . LWT = LWT { Topic : pk . WillTopic , Message : pk . WillMessage , Qos : pk . WillQos , Retain : pk . WillRetain , } } c . refreshDeadline ( c . keepalive ) }
Identify sets the identification values of a client instance.
Identify sets the identification values of a client instance .