Skip to content

Commit c9a5d31

Browse files
author
brentru
committed
fix socket, remove prints
1 parent a5f1be2 commit c9a5d31

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

adafruit_wiznet5k/adafruit_wiznet5k_socket.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ def connect(self, address, conntype=None):
144144
assert conntype != 0x03, "Error: SSL/TLS is not currently supported by CircuitPython."
145145
host, port = address
146146

147-
print(address)
148147
if hasattr(host, 'split'):
149148
host = tuple(map(int, host.split('.')))
150149
if not _the_interface.socket_connect(self.socknum, host, port, conn_mode=self._sock_type):
@@ -165,7 +164,7 @@ def recv(self, bufsize=0): #pylint: disable=too-many-branches
165164
"""Reads some bytes from the connected remote address.
166165
:param int bufsize: Maximum number of bytes to receive.
167166
"""
168-
print("Socket read", bufsize)
167+
# print("Socket read", bufsize)
169168
if bufsize == 0:
170169
# read everything on the socket
171170
while True:
@@ -191,27 +190,23 @@ def recv(self, bufsize=0): #pylint: disable=too-many-branches
191190
to_read = bufsize - len(self._buffer)
192191
received = []
193192
while to_read > 0:
194-
print("Bytes to read:", to_read)
193+
# print("Bytes to read:", to_read)
195194
if self._sock_type == SOCK_STREAM:
196195
avail = self.available()
197196
elif self._sock_type == SOCK_DGRAM:
198197
avail = _the_interface.udp_remaining()
199-
#print('Bytes Avail: ', avail)
200198
if avail:
201199
stamp = time.monotonic()
202200
if self._sock_type == SOCK_STREAM:
203-
print("to_read: {}\navail:{}\n".format(to_read, avail))
204201
recv = _the_interface.socket_read(self.socknum, min(to_read, avail))[1]
205202
elif self._sock_type == SOCK_DGRAM:
206203
recv = _the_interface.read_udp(self.socknum, min(to_read, avail))[1]
207-
print('RCV: ', recv)
208204
recv = bytes(recv)
209205
received.append(recv)
210206
to_read -= len(recv)
211207
gc.collect()
212208
if self._timeout > 0 and time.monotonic() - stamp > self._timeout:
213209
break
214-
print("{}, \nType:{}".format(received, type(received)))
215210
self._buffer += b''.join(received)
216211

217212
ret = None

0 commit comments

Comments
 (0)