Documentation
¶
Index ¶
- type IConnMgr
- type ISessDebug
- type ISession
- type MOption
- type Option
- type Server
- type Session
- func (s *Session) AllInfo() zap.Field
- func (s *Session) CloseSQ()
- func (s *Session) Get() interface{}
- func (s *Session) KeyOut() zap.Field
- func (s *Session) Read(bs []byte) error
- func (s *Session) RemoteAddr() string
- func (s *Session) RemoteInfo() zap.Field
- func (s *Session) Send(bs []byte) error
- func (s *Session) Set(v interface{})
- func (s *Session) SetRemoteAddr(addr string)
- func (s *Session) Start()
- type SessionMgr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IConnMgr ¶
type IConnMgr interface {
//ConnCount 当前连接数
ConnCount() int32
//Do handle connection
Do(conn net.Conn)
//SetLogger setup logger
SetLogger(logger *ulog.Logger)
}
IConnMgr interface 连接管理接口
type ISessDebug ¶ added in v0.5.1
type ISessDebug interface {
//KeyOut 可打印的关键信息
KeyOut() zapcore.ObjectMarshaler
//All Debug info
All() zapcore.ObjectMarshaler
}
ISessDebug : 做调试用的信息
type ISession ¶ added in v0.5.0
type ISession interface {
//Read : read
Read(s *Session) error
//OnExit : on exit -- for notify
OnExit(s *Session)
}
ISession session handler
type MOption ¶
type MOption func(o *_SessMgrOpt)
MOption session mgr option
func WithReadTimeout ¶
WithReadTimeout : setup read timeout
func WithWriteTimeout ¶
WithWriteTimeout : setup write timeout
type Option ¶
type Option func(o *_SrvStartOpt)
Option server start option
func WithAccMaxDelay ¶
WithAccMaxDelay : setup acceptMaxDelay
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server : tcp server frame
func NewTCPSrvX ¶
NewTCPSrvX : use a simple IConnMgr
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session session
func (*Session) CloseSQ ¶ added in v0.5.0
func (s *Session) CloseSQ()
CloseSQ : close send msg queue
func (*Session) RemoteInfo ¶ added in v0.5.2
RemoteInfo : for uber log
func (*Session) SetRemoteAddr ¶ added in v0.5.2
SetRemoteAddr :
Click to show internal directories.
Click to hide internal directories.