Called when client sends CONNECT; return CONNACK
OptionalonCalled when connection closed
OptionalonCalled when an error ends the session, after its DISCONNECT is sent
OptionalonCalled when client sends PUBLISH
Called when packet ready to send to client (required)
OptionalonCalled when client sends SUBSCRIBE; return SUBACK
OptionalonCalled when client sends UNSUBSCRIBE; return UNSUBACK
All lifecycle hooks (server-side).