server

package
v0.0.0-...-bc2601f Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

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

type MessageServer

type MessageServer struct {
	ReqId uint64 //request id
	// contains filtered or unexported fields
}

func NewMsgServer

func NewMsgServer(network ServerService, name string, requestLifetime time.Duration) *MessageServer

func (*MessageServer) Close

func (p *MessageServer) Close()

func (*MessageServer) RegisterMsgHandler

func (p *MessageServer) RegisterMsgHandler(msgType MessageType, reqHandler func(msg []byte) []byte)

func (*MessageServer) SendAsyncRequest

func (p *MessageServer) SendAsyncRequest(msgType MessageType, payload []byte, address crypto.PublicKey, resHandler func(msg []byte)) error

func (*MessageServer) SendRequest

func (p *MessageServer) SendRequest(msgType MessageType, payload []byte, address crypto.PublicKey, timeout time.Duration) (interface{}, error)

type MessageType

type MessageType uint32

type ServerMessage

type ServerMessage interface {
	service.Message
	Data() *service.DataMsgWrapper
}

type ServerService

type ServerService interface {
	service.Service
	SendWrappedMessage(nodeID string, protocol string, payload *service.DataMsgWrapper) error
}

Jump to

Keyboard shortcuts

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