Commit Graph

104 Commits

Author SHA1 Message Date
Ben Noordhuis
a478847f74 test: add callback order test
Ensure that idle callbacks run before other callbacks.
2012-05-22 16:04:11 +02:00
Ben Noordhuis
538a562cdb test: add tcp connect timeout test 2012-05-18 01:19:56 +02:00
Ben Noordhuis
9efa8b3571 unix, windows: rework reference counting scheme
This commit changes how the event loop determines if it needs to stay alive.

Previously, an internal counter was increased whenever a handle got created
and decreased again when the handle was closed.

While conceptually simple, it turned out hard to work with: you often want
to keep the event loop alive only if the handle is actually doing something.
Stopped or inactive handles were a frequent source of hanging event loops.

That's why this commit changes the reference counting scheme to a model where
a handle only references the event loop when it's active. 'Active' means
different things for different handle types, e.g.:

 * timers: ticking
 * sockets: reading, writing or listening
 * processes: always active (for now, subject to change)
 * idle, check, prepare: only active when started

This commit also changes how the uv_ref() and uv_unref() functions work: they
now operate on the level of individual handles, not the whole event loop.

The Windows implementation was done by Bert Belder.
2012-05-17 07:07:53 +02:00
Bert Belder
beaf750700 Test: add tests for uv_poll 2012-05-03 15:52:57 +02:00
Bert Belder
d60d94e0c3 Unix: implement uv_poll 2012-05-03 15:52:56 +02:00
Bert Belder
d7a71761c4 Windows: implement uv_poll 2012-05-03 15:52:52 +02:00
Ben Noordhuis
68bed698fc unix: move loop init logic out of core.c 2012-04-04 05:54:39 -07:00
Ben Noordhuis
5a59e4924a unix: move idle code from core.c to idle.c 2012-04-04 05:25:34 +02:00
Ben Noordhuis
dd31265751 unix: move check code from core.c to check.c 2012-04-04 05:25:34 +02:00
Ben Noordhuis
f1a19e6d34 unix: move prepare code from core.c to prepare.c 2012-04-04 05:25:34 +02:00
Ben Noordhuis
f7359a335c unix: move async code from core.c to async.c 2012-04-04 05:25:34 +02:00
Ben Noordhuis
fd987a26fe unix: move timer code from core.c to timer.c 2012-04-04 05:25:27 +02:00
Ben Noordhuis
c733cb807d build: sort source files 2012-04-04 05:12:02 +02:00
Ben Noordhuis
396d1383fe Merge branch 'v0.6' 2012-04-02 23:50:27 +02:00
Ben Noordhuis
9c8f6dd4f9 build: define _DARWIN_USE_64_BIT_INODE=1 on OS X
Fixes a segmentation fault on some OS X systems due to sizeof(struct stat)
mismatches.
2012-04-02 23:49:53 +02:00
Ben Noordhuis
685b36ba66 linux: tidy up syscall code 2012-03-31 00:19:01 +00:00
saghul
e729a82e7d build: don't link against the Carbon framework
Unused. The Makefile doesn't link against it either.
2012-03-26 00:13:55 +02:00
Ben Noordhuis
e190162975 test: test cross-process handle send/recv 2012-03-09 09:12:53 -08:00
Bert Belder
e99fba47c8 Merge remote-tracking branch 'origin/v0.6'
Conflicts:
	src/win/pipe.c
	test/run-tests.c
2012-03-09 16:41:12 +01:00
Bert Belder
422a898a7f Tests: verify that shutdown_cb is always called 2012-03-09 05:00:11 +01:00
Ben Noordhuis
a93dc7ef11 build: link against libdl on linux 2012-03-05 15:36:27 +01:00
Shigeki Ohtsu
b55801f225 win, unix: add uv_dlerror() and uv_dlerror_free() 2012-03-02 16:39:21 +01:00
Ben Noordhuis
d3efefb043 linux: share inotify fd across event loop
Previously, a new inotify fd was created for each watcher, making it quite easy
to run into the system-wide fs.inotify.max_user_instances limit (usually 128).

Fixes #300.
2012-02-23 09:21:30 -08:00
Ben Noordhuis
4e1f2b1f64 Merge remote-tracking branch 'origin/v0.6' 2012-02-12 16:10:05 +01:00
Ben Noordhuis
c5aa86bd39 Remove uv_import() and uv_export().
Not needed anymore now that support for isolates has been removed from Node.

This commit reverts the following commits:

  812e410 test: fix up stream import/export test
  e34dc13 unix: implement uv_import() and uv_export()
  d1a0e8e test: fix undefined macro error
  2ce0058 import/export streams accross loops
2012-02-12 15:49:54 +01:00
Roman Shtylman
9fa2cf2eac test: add multicast TTL test 2012-02-06 15:02:39 +01:00
Ben Noordhuis
65bbf02dc5 build: bump _WIN32_WINNT to 0x600
Commit b471b33 updated the Makefile, this commit updates the gyp file.
2012-02-01 15:26:01 +01:00
isaacs
243cfcd078 Merge remote-tracking branch 'ry/v0.6' 2012-01-31 18:00:59 -08:00
Ben Noordhuis
cd16ba5186 test: add UDP broadcast/multicast/ttl tests 2012-01-31 16:52:27 +01:00
Igor Zinkovsky
2ce0058251 import/export streams accross loops 2012-01-30 21:44:27 +01:00
Shigeki Ohtsu
ba52023ef3 Fix missing increments of loop->counters 2011-12-12 18:01:26 +01:00
Igor Zinkovsky
dceb3e65ca uv_cwd + uv_chdir 2011-12-01 12:27:12 -08:00
Ben Noordhuis
ec37d05d66 Revert "build: compile with -D__DARWIN_64_BIT_INO_T on OS X"
This reverts commit 01fbe7bf37.

__DARWIN_64_BIT_INO_T is a no-op in most cases and might be actively harmful in
some others.
2011-12-01 21:02:29 +01:00
Ben Noordhuis
01fbe7bf37 build: compile with -D__DARWIN_64_BIT_INO_T on OS X
Fixes a struct stat size mismatch on 64 bits machines that made Node crash with
a EXC_BAD_ACCESS on startup.

Solution proposed by Paddy Byers.
2011-11-18 21:16:24 +01:00
Igor Zinkovsky
f1859eb841 windows: convert WSAECONNABORTED to EOF 2011-11-07 16:53:27 -08:00
Ryan Dahl
0698e3f905 Fix UNIX pipe connect error reporting, add test 2011-11-03 15:47:43 -07:00
Bert Belder
90e15f1110 Implement uv_dlopen and friends 2011-10-29 00:52:34 +02:00
Bert Belder
04b3c65ec8 Add common.gypi to gyp-generated projects 2011-10-29 00:48:40 +02:00
Igor Zinkovsky
314d0ee4f6 windows: don't fail uv_listen with UV_EALREADY if already listening. fixes #227. 2011-10-26 13:48:53 -07:00
Ben Noordhuis
3ecb319128 build: sunos expects -pthreads, not -pthread 2011-10-25 23:52:03 +00:00
Ben Noordhuis
ec825ffc62 unix: add TCP keepalive and no-delay control knobs 2011-10-21 16:08:26 -07:00
Igor Zinkovsky
54982a23ef windows: stdio over non-overlapped pipes 2011-10-20 15:14:39 -07:00
Ben Noordhuis
1e0d25a39a build: fix gyp script, broken in 4ab1990 2011-10-15 00:04:30 +02:00
Frank DENIS
4ab1990064 unix: add support for OpenBSD 2011-10-14 01:59:45 +02:00
Ben Noordhuis
014394df3a build: compile all targets with large file support 2011-10-12 01:42:25 +00:00
Roman Shtylman
a3d1f6fd6f add uv_udp_set_membership for unix multicast support
- test-udp-multicast-join tests that multicast packets can be received
- stub src/win/udp.c until support added
2011-10-11 21:25:20 +02:00
Ben Noordhuis
732169565e sunos: link against libkstat 2011-10-10 20:47:30 +00:00
Ryan Dahl
60c639fd57 Merge branch 'ipc2' 2011-10-06 10:18:13 -07:00
Igor Zinkovsky
81c4043c83 ipc on windows 2011-10-06 10:17:42 -07:00
Ryan Dahl
bb6b629e6a make test-ipc accept the pending tcp server 2011-10-06 10:17:18 -07:00