-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
Description
Maybe not a bug.
This looks like a change due to the recent net
reimplementation. It is uncommon for my app to reach this code so it took me a while to realise that this logic stopped working.
If this is an intended change, then the doco should probably highlight this. In short, this is a user visible change.
Expected behavior
Issuing a TCP conn:close()
triggers a conn:on("disconnection", ...
.
Actual behavior
disconnection not triggered
Test code
My old code, which worked
conn:on("disconnection", function(conn, data)
Log ("disconnected")
do_file ("save")
end)
conn:on("receive", function(conn, data)
Log ("received '%s'", data)
conn:close()
end)
but now I need to do
conn:on("disconnection", function(conn, data)
Log ("disconnected")
-- does not normally happen
end)
conn:on("receive", function(conn, data)
Log ("received '%s'", data)
conn:close()
do_file ("save")
end)
People who do not bother issuing the close()
before a dsleep/restart will not see a problem.
NodeMCU version
Recent dev
.
Hardware
Any.