vRp.CD2g_test/server/client/client_core.go

18 lines
536 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package client
type Core interface {
// Run 启动客户端
// - runState: 运行状态,当客户端启动完成时,应该向该通道发送 error 或 nil
// - receive: 接收到数据包时应该将数据包发送到该函数wst 表示 websocket 的数据类型data 表示数据包
Run(runState chan<- error, receive func(wst int, packet []byte))
// Write 向客户端写入数据包
Write(packet *Packet) error
// Close 关闭客户端
Close()
// GetServerAddr 获取服务器地址
GetServerAddr() string
}