remove client.Dial/Close

Was a hack to make qperf faster
This commit is contained in:
Miek Gieben 2011-09-10 21:12:46 +02:00
parent befa590883
commit c9332fad8c
2 changed files with 2 additions and 18 deletions

View File

@ -54,6 +54,7 @@ func main() {
c.Net = "tcp"
}
/*
if !*tcp {
// For UDP give each goroutine a socket.
// With TCP we re-dial every time
@ -63,6 +64,7 @@ func main() {
}
defer c.Close()
}
*/
r := new(dns.Msg)
for {

View File

@ -190,24 +190,6 @@ func (w *reply) Write(m *Msg) {
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
// channel set in the Client c. If no channel is set DefaultQueryChan is used.
func (c *Client) Do(m *Msg, a string) {