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:
parent
75529a202f
commit
63fc3e5ab3
1 changed files with 2 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue