server

package
v0.3.10-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2018 License: Apache-2.0 Imports: 20 Imported by: 2

Documentation

Index

Constants

View Source
const (
	TlsPort uint16 = 443
)

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 *SessionList
	ActionMap   map[string]Handler
	TxHashMap   map[string]string //key: txHash   value:sessionid
	// contains filtered or unexported fields
}

func InitWsServer

func InitWsServer(node protocol.Noder, wallet vault.Wallet) *WsServer

func (*WsServer) Broadcast

func (ws *WsServer) Broadcast(data []byte) error

func (*WsServer) GetClientsById

func (ws *WsServer) GetClientsById(cliendID []byte) []*Session

func (*WsServer) GetNetNode

func (ws *WsServer) GetNetNode() (protocol.Noder, error)

func (*WsServer) GetWallet

func (ws *WsServer) GetWallet() (vault.Wallet, error)

func (*WsServer) IsValidMsg

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

func (*WsServer) NotifyWrongClients

func (ws *WsServer) NotifyWrongClients()

func (*WsServer) OnDataHandle

func (ws *WsServer) OnDataHandle(curSession *Session, messageType int, bysMsg []byte, r *http.Request) bool

func (*WsServer) PushResult

func (ws *WsServer) PushResult(resp map[string]interface{})

func (*WsServer) PushTxResult

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

func (*WsServer) Restart

func (ws *WsServer) Restart()

func (*WsServer) SendRelayPacket

func (ws *WsServer) SendRelayPacket(clientId string, msg *client.OutboundMessage)

func (*WsServer) SetTxHashMap

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

func (*WsServer) Start

func (ws *WsServer) Start() error

func (*WsServer) Stop

func (ws *WsServer) Stop()

Jump to

Keyboard shortcuts

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