[nodejs] Why net.createServer() and not new net.Server()?

65 views
Skip to first unread message

Alexander Teinum

unread,
Apr 4, 2010, 7:40:40 PM4/4/10
to nod...@googlegroups.com
I’ve got a question about the Node API. It should be noted that I’m only familiar with its interface, and not so much with the inner workings. I’ve been wondering for some time why there are create functions for stuff like creating a server or creating a child process.

Wouldn’t it be cleaner to write “new net.Server()”? Perhaps it’s needed as a glue between the “C to JavaScript” layer? Or does it just look cool? :)


--
Best regards,

Alexander Teinum

r...@tinyclouds.org

unread,
Apr 4, 2010, 10:19:31 PM4/4/10
to nod...@googlegroups.com

There was a reason for it long ago. Due to the way I structured the
C++ stuff constructors couldn't take arguments. This is no longer the
case and future API will use 'new' to construct servers and sockets.

Alexander Teinum

unread,
Apr 5, 2010, 5:09:23 AM4/5/10
to nod...@googlegroups.com
Nice. I look forward to that!


Aleaxander


--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.

Reply all
Reply to author
Forward
0 new messages