Commit Graph

47 Commits

Author SHA1 Message Date
Ben Noordhuis
3fb6612233 include: uv_alloc_cb now takes uv_buf_t*
Passing or returning structs as values makes life hard for people that
work with libuv through a foreign function interface. Switch to a
pointer-based approach.

Fixes #684.
2013-09-01 07:57:31 +02:00
Ben Noordhuis
3ee4d3f183 unix, windows: return error codes directly
This commit changes the libuv API to return error codes directly rather
than storing them in a loop-global field.

A code snippet like this one:

    if (uv_foo(loop) < 0) {
      uv_err_t err = uv_last_error(loop);
      fprintf(stderr, "%s\n", uv_strerror(err));
    }

Should be rewritten like this:

    int err = uv_foo(loop);
    if (err < 0)
      fprintf(stderr, "%s\n", uv_strerror(err));

The rationale for this change is that it should make creating bindings
for other languages a lot easier: dealing with struct return values is
painful with most FFIs and often downright buggy.
2013-07-07 09:51:00 +02:00
Ben Noordhuis
4ba03ddd56 unix, windows: rename uv_run2 to uv_run
This changes the prototype of uv_run() from:

  int uv_run(uv_loop_t* loop);

To:

  int uv_run(uv_loop_t* loop, uv_run_mode mode);

Where `mode` is UV_RUN_DEFAULT, UV_RUN_ONCE or UV_RUN_NOWAIT.

Fixes #683.
2013-01-16 23:35:29 +01:00
Ben Noordhuis
847182cdf1 test, bench: make functions/variables static
Make functions and variables that are local to the compilation unit
static. Remove what turns out to be unused.
2013-01-06 22:31:48 +01:00
Ben Noordhuis
7ff6f29b85 test, bench: ANSI-fy function prototypes
Replace `void f()` with `void f(void)`; the former means "a function
that takes any number of arguments, including none" while the latter
is what is actually intended: a function taking no arguments.

The first form also isn't strictly conforming ANSI/ISO C.
2013-01-06 22:31:48 +01:00
Ben Noordhuis
c252bcb3f0 bench: fix loop starvation bug
Don't keep writing until the write queue fills up. On fast systems (mine), that
never happens - the data is sent out as fast as the benchmark generates it.
2012-11-15 01:02:07 +01:00
Bert Belder
47eb03490a test: move loop cleanup code to the individual tests 2012-10-17 01:24:49 +02:00
Igor Zinkovsky
faca1402ef make uv_pipe_connect return void 2011-11-04 16:06:53 -07:00
Ryan Dahl
6921d2fc07 Add argument to uv_pipe_init for IPC, unix impl 2011-10-06 10:17:07 -07:00
Erick Tryzelaar
533418d4da test and bench: assert return values of *_init functions in tests 2011-09-15 22:33:48 +02:00
Bert Belder
0dc564a2aa Remove uv_init calls from tests and benchmarks 2011-09-12 11:32:41 -07:00
Bert Belder
b44ecf9929 multiplicity: update benchmarks 2011-08-31 05:18:48 +02:00
Bert Belder
3aec77f9d4 bring back uv_init 2011-08-31 04:19:07 +02:00
Ryan Dahl
56dcaf9b06 unix: multiplicity 2011-08-31 04:18:55 +02:00
Ben Noordhuis
36ce74f2ca Add UDP support to libuv. 2011-08-24 04:55:01 +02:00
Ben Noordhuis
78e94e9589 bench: remove unused locals from benchmark-pump.c 2011-07-29 21:07:09 +02:00
Igor Zinkovsky
e7497227bd merge uv_tcp_listen and uv_pipe_listen into uv_listen 2011-07-22 16:57:09 -07:00
Igor Zinkovsky
4d31f838b0 Windows: handle ERROR_PIPE_BUSY in uv_pipe_connect 2011-07-18 13:02:32 -07:00
Bert Belder
902dd567b1 Benchmarks use the improved request api 2011-07-14 10:46:34 -07:00
Igor Zinkovsky
f5ff869488 allocate windows pipe handles on demand 2011-07-13 20:43:10 -07:00
Igor Zinkovsky
2e49cc56d1 Rename uv_pipe_create to uv_pipe_bind.
Fixes issue #97.
2011-07-11 15:24:35 -07:00
Igor Zinkovsky
b6a6dae34f Named pipes implementation for Windows 2011-07-09 21:41:04 +02:00
Ryan Dahl
ce8ff3031c src/ and include/ directories
Helps #71 but does not update the MSVC files.
2011-07-07 07:52:57 -07:00
Igor Zinkovsky
320057d588 uv_stream_t 2011-07-01 05:28:02 -07:00
Bert Belder
4eb06151bd Split up uv_loop type 2011-06-17 23:00:39 +02:00
Ryan Dahl
aabe56b680 uv_tcp_init() must be called before uv_accept()
Windows broken.
2011-06-09 23:33:33 +02:00
Ryan Dahl
b3863c8051 nread should have type ssize_t 2011-06-09 19:45:19 +02:00
Ryan Dahl
04b6aaeb44 API Change: Move close_cb to uv_close from init functions 2011-06-08 05:44:22 -07:00
Ryan Dahl
7db9629f87 API Change: Remove data parameters from init functions 2011-06-08 05:43:02 -07:00
Bert Belder
cfca30433f API change: report accept errors to connection_cb 2011-06-07 18:11:43 +02:00
Bert Belder
fbd2d7a194 Misc. cleanups 2011-06-07 18:11:42 +02:00
Ryan Dahl
8a0742910c accept_cb -> connection_cb 2011-06-07 14:12:25 +02:00
Ryan Dahl
7770b1a1f6 API change: alloc_cb moved to uv_read_start()
Fixes #47.
2011-06-03 02:30:00 -07:00
Ryan Dahl
6b07791598 API Change: Pass sockaddr_in by value instead of reference 2011-06-03 02:19:35 -07:00
Ryan Dahl
11a4ad50c8 Separate out uv_handle_t into different types
Fixes #4
2011-06-03 11:03:52 +02:00
Ryan Dahl
f0ebf0c7fc Split pump bench into two processes.
And add a pump test with 1 client.
2011-05-27 01:32:48 -07:00
Ryan Dahl
103099e175 pump: connect to 127.0.0.1 instead of 0.0.0.0 2011-05-18 21:18:52 -07:00
Ryan Dahl
452681fbe9 fix port conflict 2011-05-16 17:55:11 -07:00
Bert Belder
1676e4abcc Please, declare vars at the top 2011-05-17 02:29:20 +02:00
Bert Belder
810651e04c Update tests & benchmarks to use the new timer api 2011-05-17 01:17:48 +02:00
Ryan Dahl
2b8812ffe1 uv_buf -> uv_buf_t 2011-05-13 07:15:02 -07:00
Ryan Dahl
d2653df01b Last but if oio renaming 2011-05-12 17:53:21 -07:00
Ryan Dahl
2ef3c6c632 oio -> uv 2011-05-11 20:21:49 -07:00
Ryan Dahl
1925a091d8 Only report read throughput from pump bench
Generally they are the same anyway...
2011-05-10 00:44:50 -07:00
Ryan Dahl
1b85c9f211 Parsable output from pump bench 2011-05-09 21:29:33 -07:00
Bert Belder
3530433dd1 Memory leak in pump benchmark 2011-05-10 02:43:10 +02:00
Bert Belder
391f0098de Loopback pump benchmark 2011-05-10 01:39:54 +02:00