rpc_client

package
v0.0.0-...-487d906 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2015 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoClient   = errors.New("RPC Client not found ")
	ErrCallFailed = errors.New("RPC Client Call failed ")
	ErrNeedReply  = errors.New("RPC Client Call needs reply pointer ")
)

Functions

This section is empty.

Types

type Conn

type Conn struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewConn

func NewConn(newClientCodec NewClientCodec,
	addr net.Addr,
	stream_type string,
	key string,
	timo time.Duration,
	tlsConfig *tls.Config) (*Conn, error)

func (*Conn) Close

func (c *Conn) Close()

func (*Conn) Hold

func (c *Conn) Hold()

func (*Conn) Release

func (c *Conn) Release()

func (*Conn) Shutdown

func (c *Conn) Shutdown()

func (*Conn) String

func (c *Conn) String() string

type ConnPool

type ConnPool struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewPool

func NewPool(newClientCodec NewClientCodec,
	maxTime time.Duration,
	timo time.Duration,
	tlsConfig *tls.Config) *ConnPool

NewPool is used to make a new connection pool Maintain at most one connection per host, for up to maxTime. Set maxTime to 0 to disable reaping. If TLS settings are provided outgoing connections use TLS.

func (*ConnPool) Call

func (p *ConnPool) Call(addr net.Addr, stream_type string, version rpc_stream.MuxVersion,
	method string, args interface{}, reply interface{}) error

Call is used to make an RPC call to a remote host

func (*ConnPool) Close

func (p *ConnPool) Close()

func (*ConnPool) Go

func (p *ConnPool) Go(addr net.Addr, stream_type string, version rpc_stream.MuxVersion,
	method string, args interface{}, reply interface{}, done chan *rpc.Call) (*rpc.Call, *Conn)

Go is used to make an RPC Go call to a remote host

func (*ConnPool) RPC

func (p *ConnPool) RPC(addr net.Addr, stream_type string, version rpc_stream.MuxVersion,
	method string, args interface{}, reply interface{}) error

RPC is used to make an RPC call to a remote host

func (*ConnPool) Shutdown

func (p *ConnPool) Shutdown(conn *Conn)

type NewClientCodec

type NewClientCodec func(conn io.ReadWriteCloser) netrpc.ClientCodec

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL