On Tue, Jul 17, 2012 at 10:07 AM, Santiago Gimeno <[email protected]> wrote: > Hello, > > In the documentation of the Socket constructor there are two options: fd and > type that I've been trying to use with no luck. > What I was trying to do was: > > 1 - Create a Unix stream socket by calling a JS function bound to a C++ > function that creates the unix socket and returns the fd. > 2 - Create a net.Socket associated to the socket created in 1. For that I > was doing: > > var my_socket = new Socket({ fd: my_fd, type: 'unix' } ); > > 3- Connect to a remote server with socket.connect > > But this was not working at all as a new socket was created. > > By looking at the code in net.js I could not see any place where fd and type > options are handled. Am I missing something?
I'm afraid the implementation and the documentation don't quite match up. I'll fix it one way or the other (either update the code or the docs.) `type` is a no-op now. `fd` works with some restrictions: use `new Socket(fd)` instead - if fd is a socket, it must be of type SOCK_STREAM. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
