diff --git a/README b/README index 0e7daca73..8689e9c21 100644 --- a/README +++ b/README @@ -2,6 +2,17 @@ This is the new networking layer for Node. Its purpose is to abstract IOCP on windows and libev on Unix systems. We intend to eventually contain all platform differences in this library. - http://nodejs.org/ +== Design + +The goal of this library is to provide high-concurrency high-performance I/O +on all operating systems. This is a large undertaking. Some of the API +decisions may seem arbitrary but are actually borne out of various specific +platform issues. + +=== oio_read_start(), oio_read_stop() + +Originally we wanted to provide a asynchronous read function that was +similar to + diff --git a/oio-unix.c b/oio-unix.c index 83fbb3a9f..db2591124 100644 --- a/oio-unix.c +++ b/oio-unix.c @@ -561,6 +561,10 @@ void oio__read(oio_handle* handle) { oio_err_new_artificial(handle, OIO_EOF); ev_io_stop(EV_DEFAULT_UC_ &handle->read_watcher); handle->read_cb(handle, -1, buf); + + if (oio_flag_is_set(handle, OIO_SHUT)) { + oio_close(handle); + } return; } else { /* Successful read */ diff --git a/test/benchmark-ping-pongs.c b/test/benchmark-ping-pongs.c index ab592ff39..43a132169 100644 --- a/test/benchmark-ping-pongs.c +++ b/test/benchmark-ping-pongs.c @@ -201,6 +201,7 @@ BENCHMARK_IMPL(ping_pongs) { pinger_new(); oio_run(); + printf("completed_pingers %d\n", completed_pingers); ASSERT(completed_pingers == 1); return 0;