From bd1fe21718b1b1d9c77f52ff2dd12cd9c9edea30 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 23 Jul 2013 13:45:35 -0700 Subject: [PATCH] packer/rpc: remove unused test file --- packer/rpc/rpc_test.go | 43 ------------------------------------------ 1 file changed, 43 deletions(-) delete mode 100644 packer/rpc/rpc_test.go diff --git a/packer/rpc/rpc_test.go b/packer/rpc/rpc_test.go deleted file mode 100644 index 04e7eb424..000000000 --- a/packer/rpc/rpc_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package rpc - -import ( - "net" - "net/rpc" -) - -// This starts a RPC server for the given interface listening on the -// given address. The RPC server is ready when "readyChan" receives a message -// and the RPC server will quit when "stopChan" receives a message. -// -// This function should be run in a goroutine. -func testRPCServer(laddr string, name string, iface interface{}, readyChan chan int, stopChan <-chan int) { - listener, err := net.Listen("tcp", laddr) - if err != nil { - panic(err) - } - - // Close the listener when we exit so that the RPC server ends - defer listener.Close() - - // Start the RPC server - server := rpc.NewServer() - server.RegisterName(name, iface) - - go func() { - for { - conn, err := listener.Accept() - if err != nil { - // If there is an error, just ignore it. - break - } - - go server.ServeConn(conn) - } - }() - - // We're ready! - readyChan <- 1 - - // Block on waiting to receive from the channel - <-stopChan -}