udp: Add basic UDP tests

This commit is contained in:
Justin Li
2015-02-21 14:35:21 -05:00
parent 105edf21f1
commit 7512f50731
6 changed files with 218 additions and 3 deletions

View File

@@ -71,10 +71,11 @@ func (s *Server) serve(listenAddr string) error {
go func() {
response, action := s.handlePacket(buffer[:n], addr)
pool.GiveSlice(buffer)
if response != nil {
sock.WriteToUDP(response, addr)
}
pool.GiveSlice(buffer)
if glog.V(2) {
duration := time.Since(start)