The problem was that Connection::on_close was calling Detach() directly
after executing the "disconnect" event. Since we had a boolean attach count,
this was leaving sockets detached even if they had reattached in during the
event.
* Added many asserts in http.cc and net.cc to ensure that sockets are
connected when they should be.
* Changed ObjectWrap to use a reference count instead of boolean attached_
value.
* Fixed similar bug in Timer.
The constructor for TCP servers can no longer take a connection handler for
purely technical reasons. (The constructor for EventEmitter is implemented
in C++ but addListener is in javascript, and I don't want to make too many
C++ -> Javascript references.) Thus I introduce new constructor methods to
ease the creation of the servers:
node.tcp.createServer()
node.http.createServer()
These work almost the same as the old constructors.
In general we're working towards a future where no constructors are
publicly exposed or take arguments.
The HTTP events like "on_uri" are not yet using the event interface.
onMessage still is a constructor - but this will change soon.
There is one major API change in the refactor: filename extensions are now
required when requiring or including modules.
Added extra test to test-module-loading.js.