socket.recvfrom() not returning address

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
manseekingknowledge
Posts: 61
Joined: Sun Oct 29, 2017 5:14 pm

socket.recvfrom() not returning address

Post by manseekingknowledge » Wed Nov 29, 2017 7:19 am

Looks like socket.recvfrom() isn't returning the sending address correctly. The data is still returned correctly though. Doesn't see seem to matter if I use socket or usocket. Not sure if it is a bug or if I'm doing something wrong. I'm at the tip of master (MicroPython v1.9.3-65-g74fad35).

Code: Select all

data, addr = s.recvfrom(struct.calcsize('>I'))
print(addr) # Always prints ('0.0.0.0', 0)

manseekingknowledge
Posts: 61
Joined: Sun Oct 29, 2017 5:14 pm

Re: socket.recvfrom() not returning address

Post by manseekingknowledge » Thu Nov 30, 2017 2:29 am

According to this SO answer, socket.recvfrom() only works with UDP connections so keeping track of the socket to client address mapping will need to be done manually.

Post Reply