Closed
Description
When using bind
on a lwip
socket, it looks like the binding is not removed after soft-reset. Binding again to the same port is only possible after hard-reset (when calling close
before the soft reset, it is unbound, but I think the socket instances should be closed on soft reset automatically).
import os
>>> os.uname()
(sysname='ESP8266', nodename='ESP8266', release='1.5.2(80914727)', version='v1.6-217-g99fc0d1-dirty on 2016-03-13', machine='ESP module with ESP8266')
>>> import lwip
>>> so = lwip.socket()
>>> so.bind(("", 80))
>>>
PYB: soft reboot
could not find module 'boot'
>>>
MicroPython v1.6-217-g99fc0d1-dirty on 2016-03-13; ESP module with ESP8266
Type "help()" for more information.
>>> print(so)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name not defined
>>> import lwip
>>> so = lwip.socket()
>>> so.bind(("", 80))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: 128
>>> so.bind(("", 81))