@@ -223,11 +223,11 @@ def connect(self, clean_session=True):
223
223
224
224
"""
225
225
try :
226
- proto , dummy , self . broker , path = self .broker .split ("/" , 3 )
226
+ proto , dummy , broker , path = self .broker .split ("/" , 3 )
227
227
# replace spaces in path
228
228
path = path .replace (" " , "%20" )
229
229
except ValueError :
230
- proto , dummy , self . broker = self .broker .split ("/" , 2 )
230
+ proto , dummy , broker = self .broker .split ("/" , 2 )
231
231
path = ""
232
232
if proto == "http:" :
233
233
self .port = MQTT_TCP_PORT
@@ -236,11 +236,11 @@ def connect(self, clean_session=True):
236
236
else :
237
237
raise ValueError ("Unsupported protocol: " + proto )
238
238
239
- if ":" in self . broker :
240
- self . broker , port = self . broker .split (":" , 1 )
239
+ if ":" in broker :
240
+ broker , port = broker .split (":" , 1 )
241
241
port = int (port )
242
242
243
- addr = _the_sock .getaddrinfo (self . broker , self .port , 0 , _the_sock .SOCK_STREAM )[
243
+ addr = _the_sock .getaddrinfo (broker , self .port , 0 , _the_sock .SOCK_STREAM )[
244
244
0
245
245
]
246
246
self ._sock = _the_sock .socket (addr [0 ], addr [1 ], addr [2 ])
@@ -251,7 +251,7 @@ def connect(self, clean_session=True):
251
251
self .logger .debug (
252
252
"Attempting to establish secure MQTT connection..."
253
253
)
254
- self ._sock .connect ((self . broker , self .port ), _the_interface .TLS_MODE )
254
+ self ._sock .connect ((broker , self .port ), _the_interface .TLS_MODE )
255
255
except RuntimeError as e :
256
256
raise MMQTTException ("Invalid broker address defined." , e )
257
257
else :
0 commit comments