Closed juliangruber closed 6 years ago
SO CLOSE TO MAKING THIS WORK
Any updates?
Current bug is that UTP times out on windows, for example in this test.
•mafintosh> but it came down to simply being the udp socket that timed out always on windows
•mafintosh> ie no messages other than the first one comes trough
•mafintosh> so im sure it's just some flush thing i need to call on windows and then it all works
Hey,
So far when following this... I've managed to track the issue down to utp_uv.cc
in on_utp_sendto
.
The return of uv_udp_try_send
is supposed to be >= 0: number of bytes sent. Instead I'm getting back -4054
which appears to be UV__ENOSYS which I think is function not implemented.
That's where I'm at so far...
edit:
Not sure where ENOSYS is being used yet. I tried the return against all the return values here, just in case it was some translated system message, and it wasn't anything in that list.
edit 2:
If I call WSAGetLastError after uv_udp_try_send
, the first time it's hit I get 0, then 258 repeats. Using format message, 0 obviously gives us "The operation completed successfully."
. 258 gives us "The wait operation timed out."
Update after discussion with @goldbuick:
2 things
- older versions of node's libuv don't have try send implemented, and it throws a function not implemented error (edited)
- after 1 is fix, the remaining issue is scheduled_acks are never sent causing errors this comes from a difference between how libuv behaves on posix vs windows on posix we get a zero bytes read event, which in turn utp uses to trigger the send of the scheduled_acks on windows we never get a zero bytes read event, thus never sending the scheduled_acks which puts it in a loop that eventually results in a connection reset error
I have a rough build that passes all the utp native tests on windows. Going to make a PR when I can
YAYAYAY its working. Thank you so much @goldbuick.
fixed in latest
(target=4.5.0 arch=x64 platform=win32)