func (p *Peer) MessagesLost(msg *ZreMsg) bool {
	p.wantSequence++
	valid := p.wantSequence == msg.sequence
	if !valid {
		p.wantSequence--
	}
	return valid
}
MessagesLost check if messages were lost from peer, returns true if they were
FIXME not same implementation as zyre or pyre
package zyre
import (
	"context"
	"fmt"
	"time"
	zmq "github.com/go-zeromq/zmq4"
)
var (
	peerExpired = 5 * time.Second  
	peerEvasive = 3 * time.Second  
)
type peerMailbox interface {
	connect(identity []byte, endpoint string) error
	close()
	send(msg *ZreMsg) error
}
type Peer struct {
	Identity     string                           
	Name         string                           
	Headers      map[string]string                
	mailbox      peerMailbox                      
	endpoint     string                           
	origin       string                           
	evasiveAt    time.Time                        
	expiredAt    time.Time                        
	connected    bool                             
	ready        bool                             
	status       byte                             
	sentSequence uint16                           
	wantSequence uint16                           
	sendMethod   func(zmq.Socket, *ZreMsg) error  
}
func NewPeer(ctx context.Context, identity string) (p *Peer) {
	p = &Peer{
		Identity: identity,
		Name:     fmt.Sprintf("%.6s", identity),
		Headers:  make(map[string]string),
		mailbox:  &peerMailboxSocket{ctx: ctx},
	}
	p.Refresh()
	return
}
func (p *Peer) Destroy() {
	p.Disconnect()
	for k := range p.Headers {
		delete(p.Headers, k)
	}
}
func (p *Peer) Connect(from []byte, endpoint string) (err error) {
	routingID := append([]byte{1}, from...)
	p.mailbox.connect(routingID, endpoint)
	p.endpoint = endpoint
	p.connected = true
	p.ready = false
	return nil
}
func (p *Peer) Disconnect() {
	if p.connected {
		p.mailbox.close()
		p.endpoint = ""
		p.connected = false
		p.ready = false
	}
}
func (p *Peer) Send(msg *ZreMsg) error {
	var err error
	if p.connected {
		p.sentSequence++
		msg.sequence = p.sentSequence
		err = p.mailbox.send(msg)
		if err != nil {
			p.Disconnect()
		}
	}
	return err
}
func (p *Peer) Refresh() {
	p.evasiveAt = time.Now().Add(peerEvasive)
	p.expiredAt = time.Now().Add(peerExpired)
}
func (p *Peer) Header(key string) (string, bool) {
	v, ok := p.Headers[key]
	return v, ok
}