service

package
v0.0.0-...-9be9f3c Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WebSocketReadDeadline int = 15 //秒
)

Variables

View Source
var (
	ErrReadWebSocket  = errors.New("err on read data from webSocket")
	ErrWriteWebSocket = errors.New("err on write data to webSocket")
	ErrReadRPCStream  = errors.New("err on read data from rpc stream")
	ErrWriteRPCStream = errors.New("err on write data to rpc stream")
)

Functions

This section is empty.

Types

type AgentService

type AgentService struct {
	SessDieChan chan int64
	Sessions    map[string]*Session
	// contains filtered or unexported fields
}

func NewAgentService

func NewAgentService(gameServerClient pb.GameServiceClient, logger log.Logger) AgentService

func (AgentService) WebSocketServer

func (a AgentService) WebSocketServer(w http.ResponseWriter, r *http.Request)

type Session

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

func NewSession

func NewSession(id string, conn *websocket.Conn, stream pb.GameService_StreamClient, service *AgentService, logger log.Logger) *Session

func (*Session) ForwardToClient

func (s *Session) ForwardToClient(payload []byte) (err error)

func (*Session) ForwardToServer

func (s *Session) ForwardToServer(f *pb.Frame) (err error)

func (*Session) HandleClient

func (s *Session) HandleClient()

Jump to

Keyboard shortcuts

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