websocket

package
v0.0.0-...-640f24c Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2018 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

type WsServer

type WsServer struct {
	sync.RWMutex
	Upgrader websocket.Upgrader

	SessionList  *session.SessionList
	ActionMap    map[string]Handler
	TxHashMap    map[string]string //key: txHash   value:sessionid
	BroadcastMap map[string]string
	// contains filtered or unexported fields
}

func InitWsServer

func InitWsServer() *WsServer

func (*WsServer) BroadcastResult

func (this *WsServer) BroadcastResult(resp map[string]interface{})

func (*WsServer) IsValidMsg

func (this *WsServer) IsValidMsg(reqMsg map[string]interface{}) bool

func (*WsServer) OnDataHandle

func (this *WsServer) OnDataHandle(curSession *session.Session, bysMsg []byte, r *http.Request) bool

func (*WsServer) PushTxResult

func (this *WsServer) PushTxResult(txHashStr string, resp map[string]interface{})

func (*WsServer) Restart

func (this *WsServer) Restart()

func (*WsServer) SetTxHashMap

func (this *WsServer) SetTxHashMap(txhash string, sessionid string)

func (*WsServer) Start

func (this *WsServer) Start() error

func (*WsServer) Stop

func (this *WsServer) Stop()

Jump to

Keyboard shortcuts

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