MCPcopy
hub / github.com/topfreegames/pitaya / NewSessionPool

Function NewSessionPool

session/session.go:207–215  ·  view source on GitHub ↗

NewSessionPool returns a new session pool instance

()

Source from the content-addressed store, hash-verified

205
206// NewSessionPool returns a new session pool instance
207func NewSessionPool() SessionPool {
208 return &sessionPoolImpl{
209 sessionBindCallbacks: make([]func(ctx context.Context, s Session) error, 0),
210 afterBindCallbacks: make([]func(ctx context.Context, s Session) error, 0),
211 handshakeValidators: make(map[string]func(data *HandshakeData) error, 0),
212 SessionCloseCallbacks: make([]func(s Session), 0),
213 sessionIDSvc: newSessionIDService(),
214 }
215}
216
217func (pool *sessionPoolImpl) GetSessionCount() int64 {
218 return pool.SessionCount

Callers 15

NewBuilderFunction · 0.92
TestNewRemoteServiceFunction · 0.92
TestRemoteServiceRPCFunction · 0.92
TestNewAgentFunction · 0.92
TestKickFunction · 0.92
TestKickWriteErrorFunction · 0.92
TestKickEncodeErrorFunction · 0.92
TestKickNetworkErrorsFunction · 0.92

Calls 1

newSessionIDServiceFunction · 0.85

Tested by 15

TestNewRemoteServiceFunction · 0.74
TestRemoteServiceRPCFunction · 0.74
TestNewAgentFunction · 0.74
TestKickFunction · 0.74
TestKickWriteErrorFunction · 0.74
TestKickEncodeErrorFunction · 0.74
TestKickNetworkErrorsFunction · 0.74
TestAgentSendFunction · 0.74