Skip to content

v2.2.13

Compare
Choose a tag to compare
@mochi-co mochi-co released this 14 Jun 19:21

What's Changed

  • Add OnRetainPublished hook by @thedevop in #237, which is called when a retained message is published to a client/subscriber.
  • Expose SendConnack, err return on OnConnect by @mochi-co in #240, in order to support #236, in which developers need to be able to send custom connack messages and halt the connection process, a slightly breaking change was implemented;
    • The OnConnect hook now returns an error type. This value is used by server.attachClient to halt the client connection process if the value is not nil.
    • The server.sendConnack method has been exported as SendConnack, and the signature has changed to take a properties parameter. This enables developers to issue a Connack with a custom reason code/string and v5 packet properties.
    • When combined, this allows a developer to issue a Connack with a custom reason (such as Use another server or Server moved), and packet properties (server address) from within OnConnect, and return a relevant packets.Code to halt the client connection.
    • Developers wishing to issue totally custom Connack packets may call func (cl *Client) WritePacket(pk packets.Packet) error from any hook.

Full Changelog: v2.2.12...v2.2.13

Tests

  • Builds
  • Unit Tests Passing
  • Paho Interoperability Passing