mafintosh / utp-native

Native bindings for libutp
MIT License
103 stars 38 forks source link

windows prebuilt missing #8

Closed juliangruber closed 6 years ago

juliangruber commented 8 years ago

(target=4.5.0 arch=x64 platform=win32)

mafintosh commented 8 years ago

SO CLOSE TO MAKING THIS WORK

StarpTech commented 7 years ago

Any updates?

joehand commented 7 years ago

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
xoorath commented 7 years ago

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."

xoorath commented 7 years ago

Update after discussion with @goldbuick:

2 things

  1. older versions of node's libuv don't have try send implemented, and it throws a function not implemented error (edited)
  2. 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
goldbuick commented 7 years ago

I have a rough build that passes all the utp native tests on windows. Going to make a PR when I can

joehand commented 7 years ago

YAYAYAY its working. Thank you so much @goldbuick.

mafintosh commented 6 years ago

fixed in latest