Commit Graph

77 Commits

Author SHA1 Message Date
Ryan
ad9d683f9f API: rename node.Process to node.ChildProcess
This is to avoid confusion with the global "process" object, especially for
the instances of node.Process.
2009-08-26 22:36:45 +02:00
Ryan
116f4dea05 lint 2009-08-26 22:14:45 +02:00
Ryan
6025da2153 Introduce 'process' object. Also is the global object. 2009-08-26 22:14:44 +02:00
Ryan
8658999c7d Refactor node.Process to take advantage of evcom_reader/writer. 2009-08-25 01:06:49 +02:00
Ryan
17c6a67f15 Introduce node.stdio
Remove old stdout, stderr, stdin objects.
2009-08-24 21:20:26 +02:00
Ryan
a8813fcdf5 evcom upgrade - ignore sigpipe. remove error output. 2009-08-22 12:04:45 +02:00
Ryan
11df252cb9 Add simple command line switches 2009-08-03 18:21:34 +02:00
Ryan
1bf9be6b37 Add node.version 2009-08-03 17:51:35 +02:00
Ryan
41d89f611f Add DNS API.
Missing functional tests. I'm not sure how to do tests because I don't want
to rely on the fact that users have an internet connection.
2009-07-28 12:36:41 +02:00
Ryan
0fb0af3a6c Rename evnet to evcom. 2009-07-25 17:52:26 +02:00
Ryan
4aac515202 Remove unused 'using namespace std' lines. 2009-07-24 22:22:08 +02:00
Ryan
646829262f Fix evnet_buf size calculation for V8::AdjustAmountOfExternalAllocatedMemory(). 2009-07-23 18:36:28 +02:00
Ryan
eb10553634 Move node.inherit, node.path, node.cat to new file: util.js 2009-07-16 17:19:36 +02:00
Ryan
c5ab0d5a80 Upgrade liboi, which is now called evnet. 2009-07-13 16:38:25 +02:00
Ryan
1fc4dce08b Simplify and cleanup ObjectWrap.
Simplify and inline ObjectWrap::Wrap

    Inline and clean up ObjectWrap::Unwrap

    Move ObjectWrap into its own file.

    Remove handle from ObjectWrap constructor. add obj->Wrap(handle)

    Simplify Attach/Detach in ObjectWrap

    Remove ObjectWrap::InformV8ofAllocation. (Too messy/complex.)
2009-07-10 13:38:53 +02:00
Ryan
e876d6629e Fix unused variable warnings. 2009-06-28 20:11:55 +02:00
Ryan
7cd09874c6 Add Promise class 2009-06-28 19:08:27 +02:00
Ryan
70fe920fb5 Use events for all HTTP messages.
This is a rather large refactor! Mostly for the better side. I've had to
remove some functionality like req.interrupt(). A lot of other work is left
messy or incomplete.
2009-06-28 19:08:26 +02:00
Ryan
ed3d6a63d5 Further expand EventEmitter to TCP and HTTP
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.
2009-06-28 19:08:26 +02:00
Ryan
2ecd7ffe54 in the middle putting in event code. broken. 2009-06-28 19:08:25 +02:00
Ryan
5ab93502d0 Fix issue in 5b7fb10 2009-06-27 00:13:37 +02:00
Ryan
0ff62b2ea0 Move oi_buf creation to node.cc 2009-06-22 19:48:02 +02:00
Ryan
f56309deee Remove eio_warmup. Use ev_ref instead. 2009-06-22 19:32:42 +02:00
Ryan
83cb156b6f skelton of node.Process 2009-06-20 16:55:40 +02:00
Ryan
2b557c467f Namespace trimming: remove node.constants 2009-06-18 14:58:17 +02:00
Ryan
27b268b8c1 Clean ups 2009-06-17 15:05:44 +02:00
Ryan
6697cd0725 small superficial clean-ups 2009-06-13 16:47:09 +02:00
Ryan
8b49cef10b Modify the tests to use onExit hook.
No need to rely on stdout output now.
onExit callbacks should print stack trace from onExit failure
2009-06-08 19:10:36 +02:00
Ryan
f6a7fe2657 Implement onExit() hook for modules.
onExit() is similar to the onLoad() callback. onExit() is called on each
module just before the process exits. This can be used to check state in
unit tests, but not to perform I/O. The process will forcibly exit as soon
as all of the onExit callbacks are made.
2009-06-08 16:17:33 +02:00
Ryan
34a6f10695 Fix ::exit() compile issues.
Thanks Matthias!
2009-05-28 14:47:16 +02:00
Ryan
b260a9108b Add errno constants. Move all constants to node.constants namespace. 2009-05-26 19:48:49 +02:00
Ryan
3bdd042a6e Rename fatal_exception to FatalException 2009-05-26 18:18:17 +02:00
Ryan
e8f177aa2d Clean up outgoing encoding API. Generally: send(chunk, encoding). 2009-05-26 17:48:59 +02:00
Ryan
3eb4819db1 Add docs. Rename exit() to node.exit(). 2009-05-25 13:38:36 +02:00
Ryan
58c13e5192 Namespace File stuff in node.fs 2009-05-21 12:49:41 +02:00
Ryan
fb96f07ece Commit partial work in http.js. Comment out V8::Dispose(); in node.cc 2009-05-15 18:11:49 +02:00
Ryan
baed9d514d Inform V8 of external allocations.
This is sloppy: after each ObjectWrap allocation the user needs to
call ObjectWrap::InformV8ofAllocation(). In addition each class deriving
from  ObjectWrap needs to implement the virtual method size() which should
return the size of the derived class. If I was better at C++ I could
possibly make this less ugly. For now this is how it is.

Memory usage looks much better after this commit.
2009-05-15 16:28:10 +02:00
Ryan
589d8af5d4 Wrap NewInstance with TryCatch. (Was still missing the error.) 2009-05-15 01:36:51 +02:00
Ryan
febbf75302 Wrap calls in TryCatch; Check return values after UNWRAP.
This is to avoid a segfault when you don't use the API correctly.
2009-05-15 01:12:46 +02:00
Ryan
31ba3cde17 Rename TCP classes to sit in node hierarchy. 2009-05-14 20:34:14 +02:00
Ryan
427e3f5dcb Introduce NODE_SET_PROTOTYPE_METHOD which properly sets the signature. 2009-05-14 13:16:45 +02:00
Ryan
740139408d Fix memory leak in timer. 2009-05-13 23:35:36 +02:00
Ryan
3212b31ea1 Rename main.js to node.js. 2009-05-13 21:43:24 +02:00
Ryan
f6c955b7f4 Move Timer class into node namespace. 2009-05-13 21:42:18 +02:00
Ryan
4d39a3586c Path, URI, Fragment, etc were not getting passed to RequestHandler. 2009-05-12 11:39:42 +02:00
Ryan
55d840ea96 Add profile window around socket on_read. 2009-05-11 17:16:14 +02:00
Ryan
ba17940551 Add accessor File#encoding 2009-05-07 16:15:07 +02:00
Ryan
a80591aff6 Create node.http.Server and node.http.LowLevelServer
The LowLevelServer is a direct interface to the parser given people access
to things like partially received headers. This could be used to implement
an extremely optimized server which acts before parsing is complete.

Most people will be using node.http.Server which is still rather low-level
compared to other http interfaces, but does take care of some details for
you.
2009-05-06 14:54:28 +02:00
Ryan
0bb12be660 link to google profiler 2009-05-05 21:16:19 +02:00
Ryan
cfd61622ae Reference counting. Network bugs.
Connections were being garbage collected while they were still in progress
since the object would leave scope. This commit adds ObjectWrap::Attach()
and ObjectWrap::Detach() to tell v8 that an object is currently on the event
loop and will be needed in the future.

Other changes to oi_socket.c and net.cc are to fix bugs encountered while
running the HTTP server.
2009-05-05 18:15:59 +02:00