Skip to content

Commit

Permalink
Remove non-CPython socket methods; remove wsgi server
Browse files Browse the repository at this point in the history
  • Loading branch information
dhalbert committed May 28, 2022
1 parent 5b5c5c6 commit 225e539
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion adafruit_esp32spi/adafruit_esp32spi_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,15 @@ def send(self, data): # pylint: disable=no-self-use
_the_interface.socket_write(self._socknum, data, conn_mode=conntype)
gc.collect()

def recv(self, bufsize: int):
def recv(self, bufsize: int) -> bytes:
"""Reads some bytes from the connected remote address. Will only return
an empty string after the configured timeout.
:param int bufsize: maximum number of bytes to receive
"""
buf = bytearray(bufsize)
self.recv_into(buf, bufsize)
return bytes(buf)

def recv_into(self, buffer, nbytes: int = 0):
"""Read bytes from the connected remote address into a given buffer.
Expand Down

0 comments on commit 225e539

Please sign in to comment.