Example #1
0
func listen(tcp string, addr string, e chan os.Error) {
	switch tcp {
	case "tcp":
		err := dns.ListenAndServeTCP(addr, handle)
		e <- err
	case "udp":
		err := dns.ListenAndServeUDP(addr, handle)
		e <- err
	}
}
Example #2
0
func udp(addr string, e chan os.Error) {
	err := dns.ListenAndServeUDP(addr, handle)
	e <- err
	return
}