unix: Close on EOF if already shutdown
This commit is contained in:
parent
636c75e0b6
commit
e9dcf598cc
13
README
13
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
|
IOCP on windows and libev on Unix systems. We intend to eventually contain
|
||||||
all platform differences in this library.
|
all platform differences in this library.
|
||||||
|
|
||||||
|
|
||||||
http://nodejs.org/
|
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
|
||||||
|
|
||||||
|
|||||||
@ -561,6 +561,10 @@ void oio__read(oio_handle* handle) {
|
|||||||
oio_err_new_artificial(handle, OIO_EOF);
|
oio_err_new_artificial(handle, OIO_EOF);
|
||||||
ev_io_stop(EV_DEFAULT_UC_ &handle->read_watcher);
|
ev_io_stop(EV_DEFAULT_UC_ &handle->read_watcher);
|
||||||
handle->read_cb(handle, -1, buf);
|
handle->read_cb(handle, -1, buf);
|
||||||
|
|
||||||
|
if (oio_flag_is_set(handle, OIO_SHUT)) {
|
||||||
|
oio_close(handle);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
/* Successful read */
|
/* Successful read */
|
||||||
|
|||||||
@ -201,6 +201,7 @@ BENCHMARK_IMPL(ping_pongs) {
|
|||||||
pinger_new();
|
pinger_new();
|
||||||
oio_run();
|
oio_run();
|
||||||
|
|
||||||
|
printf("completed_pingers %d\n", completed_pingers);
|
||||||
ASSERT(completed_pingers == 1);
|
ASSERT(completed_pingers == 1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user