Set the stage for making the builtin modules more dynamic.
Note: this only converts crypto and net, I will add more extensions in a
later commit.
* node.h: Add utility macro for converting macro values to strings.
* node.h: Include the actual module name inside the module structure, not
just the file it was built from.
* node.h: New Macro, NODE_MODULE_DECL, for declaring an external reference
to a module structure.
* node_extensions.cc: New File, implements get_builtin_module, which
iterates over the module structures that are compiled into node.
* node.cc(node::Binding): Use the new module lookup function to find
modules.
* node_{net,crypto}.c: Add NODE_MODULEs to generate the module structure.
C-Ares doesn't go through the Name Service Switch (NSS) and thus can't
resolve certain classes of names. Generally this doesn't matter and the
whole idea of NSS is rather annoying. Nevertheless until C-Ares gets better
support, adding this hack to go through getaddrinfo() for .local domain look
up.
This reverts commit 9926dacd14.
- Adds new dgram module, for all data-gram type transports
- Supports both UDP client and servers
- Supports Unix Daemon sockets in DGRAM mode too (think syslog)
- Uses a shared Buffer and slices that as needed to be reasonably
performant.
- One supplied test program so far, test-dgram-pingpong
- Passes test cases on osx 10.6 and ubuntu 9.10u
a) create a layer of indirection in net.Stream to allow swapping in
different read/write implementations and
b) emit an 'fd' event when file descriptors are received over a UNIX pipe,
as finally as a tangential benefit
c) remove a bunch of conditionals from the primary codepaths for
ease-of-reading.