Documentation ¶
Index ¶
- Variables
- func NewACK() *ack
- func NewProcessor(ctx *context.SessionContext, notifyHandler NotifyHandler) *processor
- func NewSyncList() *syncList
- type Conn
- type NotifyHandler
- type Session
- func (s *Session) Close() error
- func (s *Session) CompareAndSwapProcessState(olds, news context.WorkState) bool
- func (s *Session) CompareAndSwapReadState(olds, news context.WorkState) bool
- func (s *Session) CompareAndSwapWriteState(olds, news context.WorkState) bool
- func (s *Session) CompareProcessState(expect context.WorkState) bool
- func (s *Session) CompareReadState(expect context.WorkState) bool
- func (s *Session) CompareState(expect context.SessionState) bool
- func (s *Session) CompareWriteState(expect context.WorkState) bool
- func (s *Session) IsWrite(noWriteHandler func(), writeHandler func()) bool
- func (s *Session) KickClose(cid int64) bool
- func (s *Session) Notify(topic string, last []byte)
- func (s *Session) PutReadBuffer(pkg packets.ControlPacket) error
- func (s *Session) Read() error
- func (s *Session) State() context.SessionState
- func (s *Session) StoreProcessState(state context.WorkState)
- func (s *Session) StoreReadState(state context.WorkState)
- func (s *Session) StoreWriteState(state context.WorkState)
- func (s *Session) Write() error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTopicsCount the count of topic is zero ErrTopicsCount = errors.New("the count of topic is zero") // ErrTopicsQoSsCount the count of topic and qoss ErrTopicsQoSsCount = errors.New("the count of topics and the count of qoss is not equal") // ErrQoSInvalid qos is invalid ErrQoSInvalid = errors.New("qos is invalid") // ErrPacketInvalid packet is invalid" ErrPacketInvalid = errors.New("packet is invalid") )
var ( // ErrClosed The client side is normally closed ErrClosed = errors.New("recv a the disconnected packet") )
Functions ¶
func NewProcessor ¶
func NewProcessor(ctx *context.SessionContext, notifyHandler NotifyHandler) *processor
NewProcessor create a new object
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is used for write/read operations on MQTT packages
type NotifyHandler ¶
NotifyHandler register recv pushcli notice
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session link painting information
func NewSession ¶
func NewSession(ctx *context.MqttSrvContext, c *poll.Conn) *Session
NewSession create a new session object
func (*Session) CompareAndSwapProcessState ¶
func (*Session) CompareAndSwapReadState ¶
func (*Session) CompareAndSwapWriteState ¶
func (*Session) CompareProcessState ¶
func (*Session) CompareReadState ¶
func (*Session) CompareState ¶
func (s *Session) CompareState(expect context.SessionState) bool
func (*Session) CompareWriteState ¶
func (*Session) IsWrite ¶
IsWrite When the write buffer is not empty return true otherwise return false
func (*Session) KickClose ¶
KickClose used to kick off the connection operation maybe a bug The second shutdown failed because of the once operation, and the first shutdown was incomplete If the store USES transactional operations, there is no bug
func (*Session) Notify ¶
Notify receive a notification that if the latest location is greater than or equal to the lastest of the record, the post triggers a pull message operation
func (*Session) PutReadBuffer ¶
func (s *Session) PutReadBuffer(pkg packets.ControlPacket) error
PutReadBuffer put pkg the packet of buffer if there is no the handle of function . create one
func (*Session) Read ¶
Read an MQTT package and call back the handle function to handle it Close the connection if something goes wrong
func (*Session) State ¶
func (s *Session) State() context.SessionState