Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

29 wiersze
848 B

  1. package client
  2. import "github.com/yosssi/gmq/mqtt/packet"
  3. // session represents a Session which is a stateful interaction
  4. // between a Client and a Server.
  5. type session struct {
  6. // cleanSession is the Clean Session.
  7. cleanSession bool
  8. // clientID is the Client Identifier.
  9. clientID []byte
  10. // sendingPackets contains the pairs of the Packet Identifier
  11. // and the Packet.
  12. sendingPackets map[uint16]packet.Packet
  13. // receivingPackets contains the pairs of the Packet Identifier
  14. // and the Packet.
  15. receivingPackets map[uint16]packet.Packet
  16. }
  17. // newSession creates and returns a Session.
  18. func newSession(cleanSession bool, clientID []byte) *session {
  19. return &session{
  20. cleanSession: cleanSession,
  21. clientID: clientID,
  22. sendingPackets: make(map[uint16]packet.Packet),
  23. receivingPackets: make(map[uint16]packet.Packet),
  24. }
  25. }