diff --git a/server.go b/server.go index 3131c085..4b8cd1a0 100644 --- a/server.go +++ b/server.go @@ -420,10 +420,10 @@ func (s *Server) attachClient(cl *Client, listener string) error { if cl.Properties.ProtocolVersion < 5 { s.SendConnack(cl, packets.ErrServerUnavailable, false, nil) } else { - s.SendConnack(cl, packets.ErrQuotaExceeded, false, nil) + s.SendConnack(cl, packets.ErrServerBusy, false, nil) } - return packets.ErrQuotaExceeded + return packets.ErrServerBusy } code := s.validateConnect(cl, pk) // [MQTT-3.1.4-1] [MQTT-3.1.4-2] diff --git a/server_test.go b/server_test.go index bf0c1257..2a255cf4 100644 --- a/server_test.go +++ b/server_test.go @@ -974,7 +974,7 @@ func TestEstablishConnectionMaximumClientsReached(t *testing.T) { err := <-o require.Error(t, err) - require.ErrorIs(t, err, packets.ErrQuotaExceeded) + require.ErrorIs(t, err, packets.ErrServerBusy) _ = r.Close() }