Documentation ¶
Index ¶
- type Connection
- func (c *Connection) Close()
- func (c *Connection) IsClosed() bool
- func (c *Connection) Send(fn string, in interface{}, out interface{}) error
- func (c *Connection) SendTimeout(fn string, in interface{}, out interface{}, timeout time.Duration) error
- func (c *Connection) ServiceInfo() *skynet.ServiceInfo
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
Click to show internal directories.
Click to hide internal directories.