1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

rcli.DialTCP(): return a net.TCPConn to allow TCP-specific operations (ie. half-close)

This commit is contained in:
Solomon Hykes 2013-01-25 11:27:47 -08:00
parent 75529a202f
commit 63fc3e5ab3

View file

@ -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 {