func (o *ResolveOp) SetCallback(f ResolveCallbackFunc) error {
	o.m.Lock()
	defer o.m.Unlock()
	if o.started {
		return ErrStarted
	}
	o.callback = f
	return nil
}
SetCallback sets the function to call when a service is resolved or an error occurs.
package dnssd
import (
	"bytes"
	"unsafe"
)
type ResolveCallbackFunc func(op *ResolveOp, err error, host string, port int, txt map[string]string)
type ResolveOp struct {
	baseOp
	name     string
	stype    string
	domain   string
	callback ResolveCallbackFunc
}
func NewResolveOp(interfaceIndex int, name, serviceType, domain string, f ResolveCallbackFunc) *ResolveOp {
	op := &ResolveOp{}
	op.SetInterfaceIndex(interfaceIndex)
	op.SetName(name)
	op.SetType(serviceType)
	op.SetDomain(domain)
	op.SetCallback(f)
	return op
}
func StartResolveOp(interfaceIndex int, name, serviceType, domain string, f ResolveCallbackFunc) (*ResolveOp, error) {
	op := NewResolveOp(interfaceIndex, name, serviceType, domain, f)
	return op, op.Start()
}
func (o *ResolveOp) Name() string {
	o.m.Lock()
	defer o.m.Unlock()
	return o.name
}
func (o *ResolveOp) SetName(n string) error {
	o.m.Lock()
	defer o.m.Unlock()
	if o.started {
		return ErrStarted
	}
	o.name = n
	return nil
}
func (o *ResolveOp) Type() string {
	o.m.Lock()
	defer o.m.Unlock()
	return o.stype
}
func (o *ResolveOp) SetType(s string) error {
	o.m.Lock()
	defer o.m.Unlock()
	if o.started {
		return ErrStarted
	}
	o.stype = s
	return nil
}
func (o *ResolveOp) Domain() string {
	o.m.Lock()
	defer o.m.Unlock()
	return o.domain
}
func (o *ResolveOp) SetDomain(s string) error {
	o.m.Lock()
	defer o.m.Unlock()
	if o.started {
		return ErrStarted
	}
	o.domain = s
	return nil
}