rpc

package
v0.0.0-...-f84f93e Latest Latest
Warning

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

Go to latest
Published: May 30, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

* * Created by Michael on 2016/8/5. * web服务器与推送服务器通讯的RPC调用 * *

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RPCClient

type RPCClient struct {
	Connected bool
	// contains filtered or unexported fields
}

func CreateClient

func CreateClient(addr string) *RPCClient

新建RPC客户端

func (*RPCClient) Call

func (this *RPCClient) Call(serviceMethod string, args interface{}, reply interface{}) error

serviceMethod 方法名字包括类名 eg: "Receiver.Receive" args 传参数 reply 返回的数据结构,一定是指针

type RPCServer

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

func CreateServer

func CreateServer() *RPCServer

新建RPC服务端

func (*RPCServer) Listen

func (this *RPCServer) Listen(port int)

func (*RPCServer) Register

func (this *RPCServer) Register(rcvr interface{})

注册服务端方法,eg. server.Register(new(Receiver))

Jump to

Keyboard shortcuts

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