Skip to content

Commit 0b39f93

Browse files
committed
2 parents a697314 + d200095 commit 0b39f93

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

README.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Here is a very simple example that subscribes to the broker $SYS topic tree and
137137
mqttc.on_connect = on_connect
138138
mqttc.on_message = on_message
139139
140-
mqttc.connect("mqtt.eclipseprojects.io", 1883, 60)
140+
mqttc.connect("test.mosquitto.org", 1883, 60)
141141
142142
# Blocking call that processes network traffic, dispatches callbacks and
143143
# handles reconnecting.
@@ -311,7 +311,7 @@ Subscriber example
311311
mqttc.on_unsubscribe = on_unsubscribe
312312
313313
mqttc.user_data_set([])
314-
mqttc.connect("mqtt.eclipseprojects.io")
314+
mqttc.connect("test.mosquitto.org")
315315
mqttc.loop_forever()
316316
print(f"Received the following message: {mqttc.user_data_get()}")
317317
@@ -345,7 +345,7 @@ publisher example
345345
mqttc.on_publish = on_publish
346346
347347
mqttc.user_data_set(unacked_publish)
348-
mqttc.connect("mqtt.eclipseprojects.io")
348+
mqttc.connect("test.mosquitto.org")
349349
mqttc.loop_start()
350350
351351
# Our application produce some messages
@@ -386,7 +386,7 @@ Example:
386386
mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)
387387
mqttc.enable_logger()
388388
389-
mqttc.connect("mqtt.eclipseprojects.io", 1883, 60)
389+
mqttc.connect("test.mosquitto.org", 1883, 60)
390390
mqttc.loop_start()
391391
392392
# Do additional action needed, publish, subscribe, ...
@@ -405,7 +405,7 @@ It's also possible to define a on_log callback that will receive a copy of all l
405405
mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)
406406
mqttc.on_log = on_log
407407
408-
mqttc.connect("mqtt.eclipseprojects.io", 1883, 60)
408+
mqttc.connect("test.mosquitto.org", 1883, 60)
409409
mqttc.loop_start()
410410
411411
# Do additional action needed, publish, subscribe, ...
@@ -521,7 +521,7 @@ Example:
521521
522522
import paho.mqtt.publish as publish
523523
524-
publish.single("paho/test/topic", "payload", hostname="mqtt.eclipseprojects.io")
524+
publish.single("paho/test/topic", "payload", hostname="test.mosquitto.org")
525525
526526
Multiple
527527
````````
@@ -537,7 +537,7 @@ Example:
537537
538538
msgs = [{'topic':"paho/test/topic", 'payload':"multiple 1"},
539539
("paho/test/topic", "multiple 2", 0, False)]
540-
publish.multiple(msgs, hostname="mqtt.eclipseprojects.io", protocol=MQTTProtocolVersion.MQTTv5)
540+
publish.multiple(msgs, hostname="test.mosquitto.org", protocol=MQTTProtocolVersion.MQTTv5)
541541
542542
543543
Subscribe
@@ -563,7 +563,7 @@ Example:
563563
564564
import paho.mqtt.subscribe as subscribe
565565
566-
msg = subscribe.simple("paho/test/topic", hostname="mqtt.eclipseprojects.io")
566+
msg = subscribe.simple("paho/test/topic", hostname="test.mosquitto.org")
567567
print("%s %s" % (msg.topic, msg.payload))
568568
569569
Using Callback
@@ -585,7 +585,7 @@ Example:
585585
# it's possible to stop the program by disconnecting
586586
client.disconnect()
587587
588-
subscribe.callback(on_message_print, "paho/test/topic", hostname="mqtt.eclipseprojects.io", userdata={"message_count": 0})
588+
subscribe.callback(on_message_print, "paho/test/topic", hostname="test.mosquitto.org", userdata={"message_count": 0})
589589
590590
591591
Reporting bugs

src/paho/mqtt/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ def reinitialise(
11531153
) -> None:
11541154
self._reset_sockets()
11551155

1156-
self.__init__(client_id, clean_session, userdata) # type: ignore[misc]
1156+
self.__init__(self.callback_api_version, client_id, clean_session, userdata) # type: ignore[misc]
11571157

11581158
def ws_set_options(
11591159
self,
@@ -2458,7 +2458,7 @@ def on_connect(self) -> CallbackOnConnect | None:
24582458
:param Client client: the client instance for this callback
24592459
:param userdata: the private user data as set in Client() or user_data_set()
24602460
:param ConnectFlags connect_flags: the flags for this connection
2461-
:param ReasonCode reason_code: the connection reason code received from the broken.
2461+
:param ReasonCode reason_code: the connection reason code received from the broker.
24622462
In MQTT v5.0 it's the reason code defined by the standard.
24632463
In MQTT v3, we convert return code to a reason code, see
24642464
`convert_connack_rc_to_reason_code()`.
@@ -2642,7 +2642,7 @@ def on_publish(self) -> CallbackOnPublish | None:
26422642
:param userdata: the private user data as set in Client() or user_data_set()
26432643
:param int mid: matches the mid variable returned from the corresponding
26442644
`publish()` call, to allow outgoing messages to be tracked.
2645-
:param ReasonCode reason_code: the connection reason code received from the broken.
2645+
:param ReasonCode reason_code: the connection reason code received from the broker.
26462646
In MQTT v5.0 it's the reason code defined by the standard.
26472647
In MQTT v3 it's always the reason code Success
26482648
:parama Properties properties: the MQTT v5.0 properties received from the broker.

0 commit comments

Comments
 (0)