How to know how many bytes available to usocket.recv() ?
Posted: Tue Jul 30, 2019 10:41 pm
How to know how many bytes available to usocket.recv() ?
Thanks.
Thanks.
Please see the new forum at
https://forum.micropython.org/
Code: Select all
bytes_rx = my_socket.recv()
print(len(bytes_rx))
eol = bytes_rx.find(b'\n')
if eol > 0:
# Got a line of text
else:
# need to try again and concatenate