Skip to content

Commit 05018ec

Browse files
committed
when connecting with TYPE_UDP, always disconnect first
1 parent 67c67ca commit 05018ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

adafruit_espatcontrol/adafruit_espatcontrol.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ def socket_connect(
188188
can be an IP address or DNS (we'll do the lookup for you. Remote port
189189
is integer port on other side. We can't set the local port"""
190190
# lets just do one connection at a time for now
191+
if conntype == self.TYPE_UDP:
192+
# always disconnect for TYPE_UDP
193+
self.socket_disconnect()
191194
while True:
192195
stat = self.status
193196
if stat in (self.STATUS_APCONNECTED, self.STATUS_SOCKETCLOSED):

0 commit comments

Comments
 (0)