This is actually a bit tricky because there are 2 generations of the socket code.
The older code used the std.ndll, and was invoked via the loader functions.
The newer code uses the functions in NativeSocket.socket and links directly to the code.
The older code is implemented in project/libs/std/Socket.cpp and needs the ndll (or links it in as a .a file)
The newer code is in src/hx/libs/std/Socket.cpp and will pull the cpp directly into the cpp code.
The _hx_std_socket_new call is from the newer code.
The newer code allocates a "SocketWrapper" class, rather than wrapping the socket-int directly as abstract data. And in fact it looks like it does not share the vkind variable and this pretty much keeps everything private.
I guess your goals are to be able to
A. create a haxe socket from your ndll file, and
B. get the actual SOCKET out of a haxe socket in you ndll code.
and there are 3 cases:
1. neko
2. older hxcpp
3. newer hxcpp
Does this sound right?
I'm thinking of something like in you haxe code, pass in some functions for "create_socket(Int):Dynamic" and "get_socket(Dynamic):Int" to you ndll and just call those.
These functions will look different on 1, 2, and 3, and I think I will need to add some code to hxcpp to support 3.