|
@@ -72,7 +72,7 @@ func (c *Connection) Publish(msg Message, timeout time.Duration) error {
|
|
message.MessageID = c.MessageID
|
|
message.MessageID = c.MessageID
|
|
c.MessageID++
|
|
c.MessageID++
|
|
c.Submit(message)
|
|
c.Submit(message)
|
|
- server.Log.Debugf("publishing message : %v, timeout %v", msg, timeout)
|
|
|
|
|
|
+ server.Log.Debugf("publishing message Id : %v, timeout %v", message.MessageID, timeout)
|
|
ch := make(chan error)
|
|
ch := make(chan error)
|
|
|
|
|
|
// we don't wait for confirm.
|
|
// we don't wait for confirm.
|
|
@@ -125,6 +125,7 @@ func (c *Connection) Close() {
|
|
c.mLock.Lock()
|
|
c.mLock.Lock()
|
|
defer c.mLock.Unlock()
|
|
defer c.mLock.Unlock()
|
|
DeviceID := c.DeviceID
|
|
DeviceID := c.DeviceID
|
|
|
|
+ c.MessageID = 1
|
|
server.Log.Infof("closing connection of device %v", DeviceID)
|
|
server.Log.Infof("closing connection of device %v", DeviceID)
|
|
if c.Conn != nil {
|
|
if c.Conn != nil {
|
|
c.Conn.Close()
|
|
c.Conn.Close()
|