Ejemplo n.º 1
0
func (z *zeroconf) quit() {
	z.pMutex.Lock()
	defer z.pMutex.Unlock()

	for name, service := range z.printers {
		C.stopBonjour(service)
		delete(z.printers, name)
	}
}
Ejemplo n.º 2
0
func (z *zeroconf) removePrinter(name string) error {
	z.pMutex.Lock()
	defer z.pMutex.Unlock()

	if service, exists := z.printers[name]; exists {
		C.stopBonjour(service)
		delete(z.printers, name)
	} else {
		return fmt.Errorf("Bonjour can't remove printer %s that hasn't been added", name)
	}
	return nil
}