Try to use Conn

This commit is contained in:
Miek Gieben 2013-09-28 20:31:29 +01:00
parent 67065da09c
commit 22977491c3
1 changed files with 9 additions and 3 deletions

View File

@ -15,12 +15,14 @@ import (
// Order of events:
// *client -> *reply -> Exchange() -> dial()/send()->write()/receive()->read()
// Do I want make this an interface thingy?
type reply struct {
// A Conn represents a connection (which may be short lived) to a DNS
// server.
type Conn struct {
net.Conn
client *Client
addr string
req *Msg
conn net.Conn
tsigRequestMAC string
tsigTimersOnly bool
tsigStatus error
@ -39,6 +41,10 @@ type Client struct {
group singleflight
}
func Exchange(m *Msg, a string) (r *Msg, rtt time.Duration, err) {
}
func (c *Client) exchangeMerge(m *Msg, a string, s net.Conn) (r *Msg, rtt time.Duration, err error) {
if !c.SingleInflight {
if s == nil {