conn

package
v0.0.0-...-be8dc82 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(si *skynet.ServiceInfo, network string, timeout time.Duration) (*Connection, error)

func NewConnectionFromNetConn

func NewConnectionFromNetConn(si *skynet.ServiceInfo, c net.Conn) (*Connection, error)

func (*Connection) Close

func (c *Connection) Close()

func (*Connection) IsClosed

func (c *Connection) IsClosed() bool

func (*Connection) Send

func (c *Connection) Send(fn string, in interface{}, out interface{}) error

Default Timeout

func (*Connection) SendTimeout

func (c *Connection) SendTimeout(fn string, in interface{}, out interface{}, timeout time.Duration) error

发送一次RPC请求

注意: 1. 参数说明 in - 客户端请求参数(BSON Encode前的数据) out - 服务器的返回结果(BSON Decode后的数据)

2. 每一次调用都会启动一个独立的goroutine, 结果通过chan返回

func (*Connection) ServiceInfo

func (c *Connection) ServiceInfo() *skynet.ServiceInfo

Jump to

Keyboard shortcuts

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