A
@alvaroav
Dear all,
Some advances by the end of the week.
I have tried from a clean code, just building a new program. I come back to the option to open the socket, send all data in a loop, and at the end of the loop, close the socket.
I am not so sure why, BUT now the ENOMEM error just appears from time to time. Moreover, I don't need any server (blocking or non-blocking) running.
Moreover, I place this exception into the loop, and allow me to "reconnect" and continue the program even if an error appers.
flag = 1
Nerrors = 0;
socketUDP = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
while (flag<200):
time.sleep(0.05)
data=bytes()
data = data + b'counter = ' + bytes(str(flag),'utf-8')
try:
sent = socketUDP.sendto(data, addr)
print(data)
led.toggle()
flag=flag+1
except OSError:
Nerrors+=1
print('error ', Nerrors)
continue
socketUDP.close()
I am thinking that the problem might come from the wifi connection to the router... I will check this next week.
BR