Node's goal is to provide an easy way to build scalable network programs. In the above example, the two second delay does not prevent the server from handling new requests.
Node tells the operating system (through epoll, kqueue, /dev/poll, or select) that it should be notified when the 2 seconds are up or if a new connection is made—then it goes to sleep.
If someone new connects, then it executes the callback, if the timeout expires, it executes the inner callback.
Every connection stream is only a small allocation heap.
What's New in This Release: [ read full changelog ]
· Performance improvements
· Long process.title support
· Net: register net.Server callback only once
· Net: fix connect queue bugs
· Debugger: fix backtrace err handling
· Use getaddrinfo instead of c-ares for dns.lookup
· Emit 'end' from crypto streams on close
· Buffer: use NO_NULL_TERMINATION flag
· http: Added support for HTTP PATCH verb
· Add GetCPUInfo on windows
· Don't use a separate context for the repl.
· zlib Update 'availOutBefore' value, and test
· child_process.fork: don't modify args
· tls: requestCert unusable with Firefox and Chrome
· tls: The TLS API is inconsistent with the TCP API
· Net: fix error handling in listen()
· console.error now goes through uv_tty_t
· Upgrade V8 to 3.7.0
· Upgrade GYP to r1081