func (c *_Conn) resume(prefix uint32) {
	// contract is used as blockId and key prefix
	keys := store.Log.Keys(prefix)
	for _, k := range keys {
		msg := store.Log.Get(k)
		if msg == nil {
			continue
		}

		// isKeyOutbound
		if (k & (1 << 4)) == 0 {
			switch msg.Type() {
			case utp.PUBLISH:
				pub := msg.(*utp.Publish)
				c.MessageIds.ResumeID(message.MID(pub.MessageID))
				notify := &utp.ControlMessage{
					MessageType: utp.PUBLISH,
					FlowControl: utp.NOTIFY,
					MessageID:   pub.MessageID,
				}
				c.send <- notify
			default:
				store.Log.Delete(k)
			}
		} else {
			store.Log.Delete(k)
		}
	}
}
// Load all stored messages and resend them to ensure DeliveryMode > 1,2 even after an application crash.
Load all stored messages and resend them to ensure DeliveryMode > 1,2 even after an application crash.
// Load all stored messages and resend them to ensure DeliveryMode > 1 2 even after an application crash .
func (c *_Conn) resume(prefix uint32) {
	keys := store.Log.Keys(prefix)
	for _, k := range keys {
		msg := store.Log.Get(k)
		if msg == nil {
			continue
		}
		if (k & (1 << 4)) == 0 {
			switch msg.Type() {
			case utp.PUBLISH:
				pub := msg.(*utp.Publish)
				c.MessageIds.ResumeID(message.MID(pub.MessageID))
				notify := &utp.ControlMessage{
					MessageType: utp.PUBLISH,
					FlowControl: utp.NOTIFY,
					MessageID:   pub.MessageID,
				}
				c.send <- notify
			default:
				store.Log.Delete(k)
			}
		} else {
			store.Log.Delete(k)
		}
	}
}
func ( c * _Conn ) resume ( prefix uint32 ) { keys := store . Log . Keys ( prefix ) for _ , k := range keys { msg := store . Log . Get ( k ) if msg == nil { continue } if ( k & ( 1 << 4 ) ) == 0 { switch msg . Type ( ) { case utp . PUBLISH : pub := msg . ( * utp . Publish ) c . MessageIds . ResumeID ( message . MID ( pub . MessageID ) ) notify := & utp . ControlMessage { MessageType : utp . PUBLISH , FlowControl : utp . NOTIFY , MessageID : pub . MessageID , } c . send <- notify default : store . Log . Delete ( k ) } } else { store . Log . Delete ( k ) } } }
Load all stored messages and resend them to ensure DeliveryMode > 1,2 even after an application crash.
Load all stored messages and resend them to ensure DeliveryMode > 1 2 even after an application crash .
// contract is used as blockId and key prefix // isKeyOutbound