structure

package
v0.0.0-...-d436db8 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	Appid             string //appid
	Uuid              string //设备唯一标识
	ProxyAddr         string //连接的proxy
	ConnectionId      uint64 //连接ID
	ConnectTime       uint64 //连接时间
	HeartbeatInterval uint32 //下次心跳间隔
	Data              []byte //用户附加信息

	Ok bool // rpc通信返回结果标记位
}

session rpc通信消息格式

type DeviceInfo

type DeviceInfo struct {
	ProxyAddr         string
	ConnectionId      uint64
	ConnectTime       uint64
	LastHeartbeat     time.Time //上次心跳时间
	HeartbeatInterval uint32

	Ok bool //rpc通信返回结果标记位
}

session 中存储设备详细信息

type Message

type Message struct {
	ProxyAddr    string
	ConnectionId uint64
	Uuid         string
	Appid        string
	Header       []byte
	Data         []byte
	Sid          uint32 // 作为header的sid 或者header中sid的ack
}

proxy与router的消息格式

func NewMessage

func NewMessage(proxyAddr string, id uint64, header, data []byte, uuid, appid string) *Message

type MessageAck

type MessageAck struct {
	Uuid string
	Sid  uint32
	Data []byte
}

router给app发送ack

type RegisterResult

type RegisterResult struct {
	ConnectionId uint64
	Success      bool
	RKey         []byte
	Appid        string
	UUid         string
	ReturnHeader []byte
}

router给proxy返回的消息格式

func NewRegisterResult

func NewRegisterResult(id uint64, succ bool, RKey []byte, appid, uuid string, header []byte) *RegisterResult

Jump to

Keyboard shortcuts

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