コード例 #1
0
// NewClient returns a new rpc.Client to handle requests to the
// set of services at the other end of the connection.
func NewClient(conn io.ReadWriteCloser) *rpc.Client {
	return rpc.NewClientWithCodec(NewClientCodec(conn))
}
コード例 #2
0
func NewClient(conn *net.UnixConn) *rpcplus.Client {
	fdReader := NewFDReader(conn)
	encBuf := bufio.NewWriter(fdReader)
	client := &gobClientCodec{fdReader, gob.NewDecoder(fdReader), gob.NewEncoder(encBuf), encBuf}
	return rpcplus.NewClientWithCodec(client)
}