Documentation ¶
Index ¶
- func NewSession(conn *kcp.UDPSession, sid uint32) face.ISession
- func NewTestStruct() face.ITest
- func ServerStartWork()
- type Request
- type Server
- func (server *Server) AddSession(conn *kcp.UDPSession)
- func (server *Server) GetSession(sid uint32) face.ISession
- func (server *Server) Init()
- func (server *Server) ListenKCP()
- func (server *Server) ListenUDP()
- func (server *Server) PrintLogo()
- func (server *Server) RemoveSession(sid uint32)
- func (server *Server) Serve()
- func (server *Server) Start()
- func (server *Server) Stop()
- type Session
- func (session *Session) ChangeRoomId(roomId uint32)
- func (session *Session) CheckAlive()
- func (session *Session) GetConnection() net.Conn
- func (session *Session) GetCurrentRoomId() uint32
- func (session *Session) GetRemoteAddress() string
- func (session *Session) GetSid() uint32
- func (session *Session) SendMessage(data []byte)
- func (session *Session) Start()
- func (session *Session) StartReader()
- func (session *Session) StartWriter()
- func (session *Session) Stop()
- type TestStruct
- type WorkerPool
- func (workerPool *WorkerPool) AddToTaskQueue(request Request)
- func (workerPool *WorkerPool) DoMessageHandler(request Request)
- func (workerPool *WorkerPool) Init()
- func (workerPool *WorkerPool) ResponseLogin(sid uint32)
- func (workerPool *WorkerPool) ResponseTest(session face.ISession)
- func (workerPool *WorkerPool) StartOneWorker(workerID int, taskQueue chan Request)
- func (workerPool *WorkerPool) StartWorkerPool()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSession ¶
func NewTestStruct ¶
func ServerStartWork ¶
func ServerStartWork()
Types ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func (*Request) GetMessage ¶
func (*Request) GetSession ¶
type Server ¶
func (*Server) AddSession ¶
func (server *Server) AddSession(conn *kcp.UDPSession)
func (*Server) RemoveSession ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) ChangeRoomId ¶
func (*Session) CheckAlive ¶
func (session *Session) CheckAlive()
func (*Session) GetConnection ¶
func (*Session) GetCurrentRoomId ¶
func (*Session) GetRemoteAddress ¶
func (*Session) SendMessage ¶
func (*Session) StartReader ¶
func (session *Session) StartReader()
func (*Session) StartWriter ¶
func (session *Session) StartWriter()
type TestStruct ¶
type TestStruct struct {
// contains filtered or unexported fields
}
func (*TestStruct) Print ¶
func (test *TestStruct) Print()
func (*TestStruct) Test ¶
func (test *TestStruct) Test()
type WorkerPool ¶
type WorkerPool struct { WorkerPoolSize uint32 TaskQueue []chan Request // contains filtered or unexported fields }
func (*WorkerPool) AddToTaskQueue ¶
func (workerPool *WorkerPool) AddToTaskQueue(request Request)
func (*WorkerPool) DoMessageHandler ¶
func (workerPool *WorkerPool) DoMessageHandler(request Request)
func (*WorkerPool) Init ¶
func (workerPool *WorkerPool) Init()
func (*WorkerPool) ResponseLogin ¶
func (workerPool *WorkerPool) ResponseLogin(sid uint32)
func (*WorkerPool) ResponseTest ¶
func (workerPool *WorkerPool) ResponseTest(session face.ISession)
test
func (*WorkerPool) StartOneWorker ¶
func (workerPool *WorkerPool) StartOneWorker(workerID int, taskQueue chan Request)
func (*WorkerPool) StartWorkerPool ¶
func (workerPool *WorkerPool) StartWorkerPool()
Click to show internal directories.
Click to hide internal directories.