wsconn

package
v0.0.0-...-b3af538 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WsConn

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

func NewWsConn

func NewWsConn(c gnet.Conn, bufPool pool.Pooler[*bytes.Buffer], framePool pool.Pooler[*frame.WsFrame]) *WsConn

func (*WsConn) AsyncWrite

func (w *WsConn) AsyncWrite(data []byte)

func (*WsConn) BytesReader

func (w *WsConn) BytesReader(buf []byte) ([]byte, int, bool)

func (*WsConn) Close

func (w *WsConn) Close() error

Close 可以重复关闭吗,TODO:应该统一gnet进行关闭,关闭的触发应该只有gnet的OnClose

func (*WsConn) ConnectTime

func (w *WsConn) ConnectTime() int64

func (*WsConn) DecodeFrame

func (w *WsConn) DecodeFrame() (bool, error)

func (*WsConn) DeviceId

func (w *WsConn) DeviceId() int64

func (*WsConn) DeviceType

func (w *WsConn) DeviceType() uint8

func (*WsConn) IsAuth

func (w *WsConn) IsAuth() bool

func (*WsConn) LocalAddr

func (w *WsConn) LocalAddr() net.Addr

func (*WsConn) RemoteAddr

func (w *WsConn) RemoteAddr() net.Addr

func (*WsConn) SetAuth

func (w *WsConn) SetAuth()

func (*WsConn) SetDeviceId

func (w *WsConn) SetDeviceId(deviceId int64)

func (*WsConn) SetDeviceType

func (w *WsConn) SetDeviceType(deviceType uint8)

func (*WsConn) SetUserId

func (w *WsConn) SetUserId(uid int64)

func (*WsConn) TryUpgrade

func (w *WsConn) TryUpgrade() (bool, error)

TryUpgrade 尝试升级 bool: 升级是否完成 err: 升级发生错误

func (*WsConn) UserId

func (w *WsConn) UserId() int64

func (*WsConn) Write

func (w *WsConn) Write(data []byte) (int, error)

Jump to

Keyboard shortcuts

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