On 7/8/2014 11:04 AM, Saúl Ibarra Corretgé wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/08/2014 07:24 PM, Akhil Arora wrote:
For an fd/SOCKET obtained externally to libuv, uv_tcp_open() works
fine on the unices, but throws an ENOTCONN on windows when
uv_read_start is called on the opened tcp handle. This error is
being generated by a call to uv__set_artificial_error in
uv_read_start(). Seems like UV_HANDLE_READABLE (and perhaps
WRITABLE) flags are not set on the handle. Should uv_tcp_open do
that, or is there another way to set these flags? This is with
libuv v0.10.27. Thanks in advance


Is the socket connected? Did you bind it? Can you provide a test case?

Yes, the socket is connected and is functional. It was returned by accept(), and a test message sent using send() just after the accept() is received OK by the client. I hack around the artificial ENOTCONN by setting the following flags on the opened tcp handle before calling uv_read_start -

  tcp->flags |= 0x00002000; // uv/src/win/internal.h: UV_HANDLE_CONNECTED
  tcp->flags |= 0x00008000; // uv/src/win/internal.h: UV_HANDLE_READABLE
  tcp->flags |= 0x00010000; // uv/src/win/internal.h: UV_HANDLE_WRITABLE

I can try to write a test case, but at the moment I am having trouble running the libuv tests (I have Visual Studio 2012 Express installed, but it's being detected as 2010) -

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools. [D:\ws\node\deps\uv\libuv.vcxproj]

VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\
VISUALSTUDIOVERSION=11.0
VS110COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\
VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 11.0\
VS_TOOLSET=x64

--
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Reply via email to