Closed cmidgley closed 2 weeks ago
Last I checked, the unit tests for Listener passed on Windows. We'll take another look.
The listener on Windows has a bug where it would end up as a blocking socket, rather than non-blocking. This led to the stalls you see. There are two places to fix that., Line 176:
ioctlsocket(tcp->skt, FIONBIO, &nonBlocking);
And line 577:
ioctlsocket(listener->skt, FIONBIO, &nonBlocking);
There is also a smaller issue – a small memory leak if an exception occurs in the constructor – which will fixed when the above changes are integrated into the SDK.
Patch applied and fix confirmed. Thank you!
Build environment: Windows Moddable SDK version: 5.1.0 Target device: Win simulator.
Description I'm trying to get
embedded:network/http/server
to work onwin
simulator, but it locks up (does not respond) the simulator process and requires it to be hard terminated. The examples forlistener/httpserver
andlistener/listen
exhibit the failure, indicating the bug is likely related tolistener
.Both examples work on
esp32
, but forhttpserver
a trivial bug inexamples/io/tcp/websocket/WebSocket.js
on line 51 needs to be fixed to not throw an error (doesn't affect the crash issue). Changeif (href)
toelse if (href)
, as the prior check forobject
has identified this is an attachment and there is nohref
.Steps to Reproduce
examples/io/listener/listen
orexamples/io/listener/httpserver
on windows simulator