websocket

package
v0.0.0-...-466c206 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CmdContextImpl

type CmdContextImpl struct {
	Conn *websocket.Conn

	SessionId int32
	// contains filtered or unexported fields
}

CmdContextImpl 就是 MyCmdContext 的 WebSocket 实现

func (*CmdContextImpl) BindUserId

func (ctx *CmdContextImpl) BindUserId(val int64)

func (*CmdContextImpl) Disconnect

func (ctx *CmdContextImpl) Disconnect()

func (*CmdContextImpl) GetClientIpAddr

func (ctx *CmdContextImpl) GetClientIpAddr() string

func (*CmdContextImpl) GetUserId

func (ctx *CmdContextImpl) GetUserId() int64

func (*CmdContextImpl) LoopReadMsg

func (ctx *CmdContextImpl) LoopReadMsg()

LoopReadMsg 循环读取消息

func (*CmdContextImpl) LoopSendMsg

func (ctx *CmdContextImpl) LoopSendMsg()

LoopSendMsg 循环发送消息

func (*CmdContextImpl) SendError

func (ctx *CmdContextImpl) SendError(errorCode int, errorInfo string)

func (*CmdContextImpl) Write

func (ctx *CmdContextImpl) Write(msgObj protoreflect.ProtoMessage)

Jump to

Keyboard shortcuts

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