Skip to content

Commit 1eb1a51

Browse files
author
brentru
committed
wait less time between checking sn_sr
1 parent 4467ffe commit 1eb1a51

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_wiznet5k/adafruit_wiznet5k.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,11 +515,11 @@ def socket_connect(self, socket_num, dest, port, conn_mode=SNMR_TCP):
515515
self._send_socket_cmd(socket_num, CMD_SOCK_CONNECT)
516516
# wait for tcp connection establishment
517517
while self.socket_status(socket_num)[0] != SNSR_SOCK_ESTABLISHED:
518+
time.sleep(0.001)
518519
if self._debug:
519-
print("STATUS:", self.socket_status(socket_num)[0])
520+
print("SN_SR:", self.socket_status(socket_num)[0])
520521
if self.socket_status(socket_num)[0] == SNSR_SOCK_CLOSED:
521522
raise RuntimeError('Failed to establish connection.')
522-
time.sleep(1)
523523
elif conn_mode == SNMR_UDP:
524524
UDP_SOCK['bytes_remaining'] = 0
525525
return 1

0 commit comments

Comments
 (0)