ws_server

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IWsTcpSvrEventHandler added in v1.0.4

type IWsTcpSvrEventHandler interface {
	OnConn(net.Conn)             // 被Listener协程调用,一个WsSvr对应一个Listener协程
	OnRead(net.Conn, []byte) int // 被Read协程调用,每个Connection对应一个Read协调
	OnClose(net.Conn)            // 被Read协程调用,每个Connection对应一个Read协调
}

type TcpConnInfo added in v1.0.4

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

type WsTcpSvr added in v1.0.4

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

func (*WsTcpSvr) Close added in v1.0.4

func (s *WsTcpSvr) Close(conn net.Conn) error

func (*WsTcpSvr) InitAndRun added in v1.0.4

func (s *WsTcpSvr) InitAndRun(implType, mod string, port int, handler IWsTcpSvrEventHandler) error

func (*WsTcpSvr) RunGinWs added in v1.0.4

func (self *WsTcpSvr) RunGinWs(mode string, wsPort int) error

Run gin start the websocket server

func (*WsTcpSvr) WriteData added in v1.0.4

func (s *WsTcpSvr) WriteData(conn net.Conn, data1 []byte, data2 []byte) error

func (*WsTcpSvr) WsBeegoPageUpgrader added in v1.0.4

func (self *WsTcpSvr) WsBeegoPageUpgrader(w http.ResponseWriter, req *http.Request)

WsBeegoPage is beego websocket handler

Jump to

Keyboard shortcuts

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