From 8255b4a03f0a389c322d6ba929a59238d94f73c6 Mon Sep 17 00:00:00 2001 From: James DeFelice Date: Thu, 6 Aug 2015 17:55:37 -0400 Subject: [PATCH] update docs; replace "data frame" refs with "raw message" --- server.go | 12 ++++++------ server_test.go | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/server.go b/server.go index 2ca613a8..6a74ea87 100644 --- a/server.go +++ b/server.go @@ -198,17 +198,17 @@ func HandleFunc(pattern string, handler func(ResponseWriter, *Msg)) { DefaultServeMux.HandleFunc(pattern, handler) } -// Writer writes DNS data frames; each call to Write should send an entire frame. +// Writer writes raw DNS messages; each call to Write should send an entire message. type Writer interface { io.Writer } -// Reader reads DNS data frames; each call to ReadTCP or ReadUDP should return an entire frame. +// Reader reads raw DNS messages; each call to ReadTCP or ReadUDP should return an entire message. type Reader interface { - // ReadTCP reads a data frame from a TCP connection. Implementations may alter + // ReadTCP reads a raw message from a TCP connection. Implementations may alter // connection properties, for example the read-deadline. ReadTCP(conn *net.TCPConn, timeout time.Duration) ([]byte, error) - // ReadUDP reads a data frame from a UDP connection. Implementations may alter + // ReadUDP reads a raw message from a UDP connection. Implementations may alter // connection properties, for example the read-deadline. ReadUDP(conn *net.UDPConn, timeout time.Duration) ([]byte, *SessionUDP, error) } @@ -263,9 +263,9 @@ type Server struct { Unsafe bool // If NotifyStartedFunc is set is is called, once the server has started listening. NotifyStartedFunc func() - // DecorateReader is optional, allows customization of the process that reads DNS frames. + // DecorateReader is optional, allows customization of the process that reads raw DNS messages. DecorateReader DecorateReader - // DecorateWriter is optional, allows customization of the process that writes DNS frames. + // DecorateWriter is optional, allows customization of the process that writes raw DNS messages. DecorateWriter DecorateWriter // For graceful shutdown. diff --git a/server_test.go b/server_test.go index c9853857..2ff606ac 100644 --- a/server_test.go +++ b/server_test.go @@ -403,12 +403,12 @@ type ExampleFrameLengthWriter struct { } func (e *ExampleFrameLengthWriter) Write(m []byte) (int, error) { - fmt.Println("writing DNS data frame of length", len(m)) + fmt.Println("writing raw DNS message of length", len(m)) return e.Writer.Write(m) } func ExampleDecorateWriter() { - // instrument DNS data frame writing + // instrument raw DNS message writing wf := DecorateWriter(func(w Writer) Writer { return &ExampleFrameLengthWriter{w} }) @@ -446,5 +446,5 @@ func ExampleDecorateWriter() { fmt.Println("failed to exchange", err.Error()) return } - // Output: writing DNS data frame of length 56 + // Output: writing raw DNS message of length 56 }