parent
befa590883
commit
c9332fad8c
|
@ -54,6 +54,7 @@ func main() {
|
||||||
c.Net = "tcp"
|
c.Net = "tcp"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
if !*tcp {
|
if !*tcp {
|
||||||
// For UDP give each goroutine a socket.
|
// For UDP give each goroutine a socket.
|
||||||
// With TCP we re-dial every time
|
// With TCP we re-dial every time
|
||||||
|
@ -63,6 +64,7 @@ func main() {
|
||||||
}
|
}
|
||||||
defer c.Close()
|
defer c.Close()
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
r := new(dns.Msg)
|
r := new(dns.Msg)
|
||||||
for {
|
for {
|
||||||
|
|
18
client.go
18
client.go
|
@ -190,24 +190,6 @@ func (w *reply) Write(m *Msg) {
|
||||||
w.Client().ChannelReply <- &Exchange{Request: w.req, Reply: m}
|
w.Client().ChannelReply <- &Exchange{Request: w.req, Reply: m}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used in qperf... for speed only??? Check...
|
|
||||||
// Dial dials a remote server and set... TODO
|
|
||||||
func (c *Client) Dial(addr string) os.Error {
|
|
||||||
conn, err := net.Dial(c.Net, addr)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
c.Hijacked = conn
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Client) Close() os.Error {
|
|
||||||
if c.Hijacked == nil {
|
|
||||||
return nil // TODO
|
|
||||||
}
|
|
||||||
return c.Hijacked.Close()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Do performs an asynchronous query. The result is returned on the
|
// Do performs an asynchronous query. The result is returned on the
|
||||||
// channel set in the Client c. If no channel is set DefaultQueryChan is used.
|
// channel set in the Client c. If no channel is set DefaultQueryChan is used.
|
||||||
func (c *Client) Do(m *Msg, a string) {
|
func (c *Client) Do(m *Msg, a string) {
|
||||||
|
|
Loading…
Reference in New Issue