|
@@ -82,7 +82,7 @@ func (c *Connection) Publish(msg Message, timeout time.Duration) error {
|
|
|
<-timer.C
|
|
|
waitCh, exist := c.MessageWaitChan[message.MessageID]
|
|
|
if exist {
|
|
|
- waitCh <- errors.New("timeout pushlishing message.")
|
|
|
+ waitCh <- errors.New("timeout pushlishing message")
|
|
|
delete(c.MessageWaitChan, message.MessageID)
|
|
|
close(waitCh)
|
|
|
}
|
|
@@ -101,6 +101,7 @@ func (c *Connection) confirmPublish(MessageID uint16) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// ValidateToken validate token
|
|
|
func (c *Connection) ValidateToken(token []byte) error {
|
|
|
|
|
|
err := c.Mgr.Provider.ValidateDeviceToken(c.DeviceID, token)
|
|
@@ -113,6 +114,7 @@ func (c *Connection) ValidateToken(token []byte) error {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
+// Close close
|
|
|
func (c *Connection) Close() {
|
|
|
DeviceID := c.DeviceID
|
|
|
server.Log.Infof("closing connection of device %v", DeviceID)
|