espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.74k stars 7.3k forks source link

ERROR: T#366378000000: CBSDSocketInterface: TCP-Socket recv() failed: Socket is not connected (IDFGH-12072) #13133

Closed diplfranzhoepfinger closed 8 months ago

diplfranzhoepfinger commented 9 months ago

Answers checklist.

General issue report

ERROR: T#366378000000: CBSDSocketInterface: TCP-Socket recv() failed: Socket is not connected

Log:

ERROR: T#361428000000: CBSDSocketInterface: TCP-Socket recv() failed: Connection reset by peer
ERROR: T#361429000000: CBSDSocketInterface: TCP-Socket recv() failed: Connection reset by peer
ERROR: T#361434000000: CBSDSocketInterface: TCP-Socket recv() failed: Socket is not connected
ERROR: T#361443000000: CBSDSocketInterface: TCP-Socket recv() failed: Socket is not connected
ERROR: T#361451000000: CBSDSocketInterface: TCP-Socket recv() failed: Socket is not connected
ERROR: T#361459000000: CBSDSocketInterface: TCP-Socket recv() failed: Socket is not connected
ERROR: T#361467000000: CBSDSocketInterface: TCP-Socket recv() failed: Socket is not connected
ERROR: T#361476000000: CBSDSocketInterface: TCP-Socket recv() failed: Socket is not connected
ERROR: T#361484000000: CBSDSocketInterface: TCP-Socket recv() failed: Socket is not connected
ERROR: T#361492000000: CBSDSocketInterface: TCP-Socket recv() failed: Socket is not connected
ERROR: T#361501000000: CBSDSocketInterface: TCP-Socket recv() failed: Socket is not connected
ERROR: T#361509000000: CBSDSocketInterface: TCP-Socket recv() failed: Socket is not connected

the function recv should return 0 in case of a Shutdown.

see https://man7.org/linux/man-pages/man2/recv.2.html

but here it returns -1 and a errno of ECONNRESET

diplfranzhoepfinger commented 9 months ago

i fixed the Bug:

diplfranzhoepfinger commented 9 months ago

4f9bd96b1d333d7d8d48667f5526025fc499f413

https://gitlab.com/meisterschulen-am-ostbahnhof-munchen/org.eclipse.4diac.forte/-/commit/4f9bd96b1d333d7d8d48667f5526025fc499f413

working, Gerrit is coming.

diplfranzhoepfinger commented 9 months ago

https://git.eclipse.org/r/c/4diac/org.eclipse.4diac.forte/+/206333

david-cermak commented 8 months ago

@diplfranzhoepfinger If I understand correctly the bug wasn't in IDF (assuming the connection wasn't closed cleanly, for more info please read https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/lwip.html#bsd-sockets-api).

Closing this issue, please reopen if my interpretation was wrong.

diplfranzhoepfinger commented 8 months ago

https://github.com/eclipse-4diac/4diac-forte/pull/18