server

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package server ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitSession added in v0.0.2

func InitSession(
	sessionServer *SessionServer,
	streamConn *adapter.StreamConn,
	stream *rpc.Stream,
)

InitSession ...

Types

type Channel added in v0.0.2

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

Channel ...

func (*Channel) Clean added in v0.0.2

func (p *Channel) Clean()

Clean ...

func (*Channel) In added in v0.0.2

func (p *Channel) In(id uint64) (canIn bool, backStream *rpc.Stream)

In ...

func (*Channel) IsTimeout added in v0.0.2

func (p *Channel) IsTimeout(nowNS int64, timeout int64) bool

IsTimeout ...

func (*Channel) Out added in v0.0.2

func (p *Channel) Out(stream *rpc.Stream) (canOut bool)

Out ...

type Server

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

Server ...

func NewServer

func NewServer(config *ServerConfig) *Server

NewServer ...

func (*Server) AddService

func (p *Server) AddService(
	name string,
	service *rpc.Service,
	config rpc.Map,
) *Server

AddService ...

func (*Server) BuildReplyCache

func (p *Server) BuildReplyCache() *base.Error

BuildReplyCache ...

func (*Server) Close

func (p *Server) Close() bool

Close ...

func (*Server) IsRunning

func (p *Server) IsRunning() bool

IsRunning ...

func (*Server) Listen

func (p *Server) Listen(
	network string,
	addr string,
	path string,
	tlsConfig *tls.Config,
	fileMap map[string]http.Handler,
) *Server

Listen ...

func (*Server) ListenWithDebug

func (p *Server) ListenWithDebug(
	network string,
	addr string,
	path string,
	tlsConfig *tls.Config,
	fileMap map[string]http.Handler,
) *Server

ListenWithDebug ...

func (*Server) Open

func (p *Server) Open() bool

Open ...

type ServerConfig added in v0.0.2

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

func GetDefaultServerConfig added in v0.0.2

func GetDefaultServerConfig() *ServerConfig

func (*ServerConfig) SetCloseTimeout added in v0.0.2

func (p *ServerConfig) SetCloseTimeout(
	closeTimeout time.Duration,
) *ServerConfig

func (*ServerConfig) SetLogFile added in v0.0.2

func (p *ServerConfig) SetLogFile(logFile string) *ServerConfig

func (*ServerConfig) SetLogLevel added in v0.0.2

func (p *ServerConfig) SetLogLevel(logLevel base.ErrorLevel) *ServerConfig

func (*ServerConfig) SetLogToScreen added in v0.0.2

func (p *ServerConfig) SetLogToScreen(logToScreen bool) *ServerConfig

func (*ServerConfig) SetMaxCallDepth added in v0.0.2

func (p *ServerConfig) SetMaxCallDepth(maxCallDepth int16) *ServerConfig

func (*ServerConfig) SetMaxNodeDepth added in v0.0.2

func (p *ServerConfig) SetMaxNodeDepth(maxNodeDepth int16) *ServerConfig

func (*ServerConfig) SetNumOfThreads added in v0.0.2

func (p *ServerConfig) SetNumOfThreads(numOfThreads int) *ServerConfig

func (*ServerConfig) SetSession added in v0.0.2

func (p *ServerConfig) SetSession(session *SessionConfig) *ServerConfig

func (*ServerConfig) SetThreadBufferSize added in v0.0.2

func (p *ServerConfig) SetThreadBufferSize(
	threadBufferSize uint32,
) *ServerConfig

func (*ServerConfig) SetactionCache added in v0.0.2

func (p *ServerConfig) SetactionCache(
	actionCache rpc.ActionCache,
) *ServerConfig

type Session added in v0.0.2

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

Session ...

func (*Session) OnConnClose added in v0.0.2

func (p *Session) OnConnClose(_ *adapter.StreamConn)

OnConnClose ...

func (*Session) OnConnError added in v0.0.2

func (p *Session) OnConnError(streamConn *adapter.StreamConn, err *base.Error)

OnConnError ...

func (*Session) OnConnOpen added in v0.0.2

func (p *Session) OnConnOpen(streamConn *adapter.StreamConn)

OnConnOpen ...

func (*Session) OnConnReadStream added in v0.0.2

func (p *Session) OnConnReadStream(
	streamConn *adapter.StreamConn,
	stream *rpc.Stream,
)

OnConnReadStream ...

func (*Session) OutStream added in v0.0.2

func (p *Session) OutStream(stream *rpc.Stream)

OutStream ...

func (*Session) TimeCheck added in v0.0.2

func (p *Session) TimeCheck(nowNS int64)

TimeCheck ...

type SessionConfig added in v0.0.2

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

SessionConfig ...

func GetDefaultSessionConfig added in v0.0.2

func GetDefaultSessionConfig() *SessionConfig

GetDefaultSessionConfig ...

func (*SessionConfig) SetHeartbeatInterval added in v0.0.2

func (p *SessionConfig) SetHeartbeatInterval(
	heartbeatInterval time.Duration,
) *SessionConfig

func (*SessionConfig) SetHeartbeatTimeout added in v0.0.2

func (p *SessionConfig) SetHeartbeatTimeout(
	heartbeatTimeout time.Duration,
) *SessionConfig

func (*SessionConfig) SetNumOfChannels added in v0.0.2

func (p *SessionConfig) SetNumOfChannels(numOfChannels int) *SessionConfig

func (*SessionConfig) SetServerCacheTimeout added in v0.0.2

func (p *SessionConfig) SetServerCacheTimeout(
	serverCacheTimeout time.Duration,
) *SessionConfig

func (*SessionConfig) SetServerMaxSessions added in v0.0.2

func (p *SessionConfig) SetServerMaxSessions(
	serverMaxSessions int,
) *SessionConfig

func (*SessionConfig) SetServerReadBufferSize added in v0.0.2

func (p *SessionConfig) SetServerReadBufferSize(
	serverReadBufferSize int,
) *SessionConfig

func (*SessionConfig) SetServerSessionTimeout added in v0.0.2

func (p *SessionConfig) SetServerSessionTimeout(
	serverSessionTimeout time.Duration,
) *SessionConfig

func (*SessionConfig) SetServerWriteBufferSize added in v0.0.2

func (p *SessionConfig) SetServerWriteBufferSize(
	serverWriteBufferSize int,
) *SessionConfig

func (*SessionConfig) SetTransLimit added in v0.0.2

func (p *SessionConfig) SetTransLimit(transLimit int) *SessionConfig

type SessionPool added in v0.0.2

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

SessionPool ...

func NewSessionPool added in v0.0.2

func NewSessionPool(sessionServer *SessionServer) *SessionPool

NewSessionPool ...

func (*SessionPool) Add added in v0.0.2

func (p *SessionPool) Add(session *Session) bool

Add ...

func (*SessionPool) Get added in v0.0.2

func (p *SessionPool) Get(id uint64) (*Session, bool)

Get ...

func (*SessionPool) TimeCheck added in v0.0.2

func (p *SessionPool) TimeCheck(nowNS int64)

TimeCheck ...

type SessionServer added in v0.0.2

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

SessionServer ...

func NewSessionServer added in v0.0.2

func NewSessionServer(
	listeners []*listener,
	config *SessionConfig,
	streamReceiver rpc.IStreamReceiver,
) *SessionServer

SessionServer ...

func (*SessionServer) AddSession added in v0.0.2

func (p *SessionServer) AddSession(session *Session) bool

AddSession ...

func (*SessionServer) Close added in v0.0.2

func (p *SessionServer) Close()

Close ...

func (*SessionServer) CreateSessionID added in v0.0.2

func (p *SessionServer) CreateSessionID() uint64

CreateSessionID ...

func (*SessionServer) GetSession added in v0.0.2

func (p *SessionServer) GetSession(id uint64) (*Session, bool)

GetSession ...

func (*SessionServer) OnConnClose added in v0.0.2

func (p *SessionServer) OnConnClose(_ *adapter.StreamConn)

OnConnClose ...

func (*SessionServer) OnConnError added in v0.0.2

func (p *SessionServer) OnConnError(streamConn *adapter.StreamConn, err *base.Error)

OnConnError ...

func (*SessionServer) OnConnOpen added in v0.0.2

func (p *SessionServer) OnConnOpen(_ *adapter.StreamConn)

OnConnOpen ...

func (*SessionServer) OnConnReadStream added in v0.0.2

func (p *SessionServer) OnConnReadStream(
	streamConn *adapter.StreamConn,
	stream *rpc.Stream,
)

OnConnReadStream ...

func (*SessionServer) Open added in v0.0.2

func (p *SessionServer) Open()

Open ...

func (*SessionServer) OutStream added in v0.0.2

func (p *SessionServer) OutStream(stream *rpc.Stream)

OutStream ...

func (*SessionServer) TimeCheck added in v0.0.2

func (p *SessionServer) TimeCheck(nowNS int64)

TimeCheck ...

func (*SessionServer) TotalSessions added in v0.0.2

func (p *SessionServer) TotalSessions() int64

TotalSessions ...

Jump to

Keyboard shortcuts

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