Try to use Conn
This commit is contained in:
parent
67065da09c
commit
22977491c3
12
client.go
12
client.go
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue