Page 1 of 1

[ESP8266] How to get client address when using readinto?

Posted: Tue Sep 14, 2021 2:30 pm
by MrJake222
Hello,

I'm confused. My code:

Code: Select all

# bad, no sender data
cnt = s.readinto(self._buffer, BUFSIZE)
print(cnt, self._buffer)

# bad, allocates new buffer
buf, peer = s.recvfrom(BUFSIZE)
print(buf, peer)
How to achieve recvfrom_into functionality from CPython? I don't want to allocate new buffers constantly and have an address to reply to. How?