From 63fc3e5ab38893e1359f218a855908a4c0303ace Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Fri, 25 Jan 2013 11:27:47 -0800 Subject: [PATCH] rcli.DialTCP(): return a net.TCPConn to allow TCP-specific operations (ie. half-close) --- rcli/tcp.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rcli/tcp.go b/rcli/tcp.go index 572dabb56c..c2703a712f 100644 --- a/rcli/tcp.go +++ b/rcli/tcp.go @@ -10,7 +10,7 @@ import ( "bufio" ) -func CallTCP(addr string, args ...string) (io.ReadWriteCloser, error) { +func CallTCP(addr string, args ...string) (*net.TCPConn, error) { cmd, err := json.Marshal(args) if err != nil { return nil, err @@ -22,7 +22,7 @@ func CallTCP(addr string, args ...string) (io.ReadWriteCloser, error) { if _, err := fmt.Fprintln(conn, string(cmd)); err != nil { return nil, err } - return conn, nil + return conn.(*net.TCPConn), nil } func ListenAndServeTCP(addr string, service Service) error {