Update Exchange documention about retries

Exchange does not fallback to tcp, nor will retry the query. Make
this more clear.
This commit is contained in:
Miek Gieben 2013-12-27 07:48:30 +00:00
parent aeb172ad1a
commit 902ff847c8
1 changed files with 4 additions and 1 deletions

View File

@ -37,7 +37,8 @@ type Client struct {
}
// Exchange performs a synchronous UDP query. It sends the message m to the address
// contained in a and waits for an reply.
// contained in a and waits for an reply. Exchange does not retry a failed query, nor
// will it fallback to TCP in case of truncation.
func Exchange(m *Msg, a string) (r *Msg, err error) {
var co *Conn
co, err = DialTimeout("udp", a, dnsTimeout)
@ -81,6 +82,8 @@ func ExchangeConn(c net.Conn, m *Msg) (r *Msg, err error) {
// c := new(dns.Client)
// in, rtt, err := c.Exchange(message, "127.0.0.1:53")
//
// Exchange does not retry a failed query, nor will it fallback to TCP in
// case of truncation.
func (c *Client) Exchange(m *Msg, a string) (r *Msg, rtt time.Duration, err error) {
if !c.SingleInflight {
return c.exchange(m, a)