p2
0.0
|
create a Aio_stream
More...
Public Member Functions | |
static PN | aio_shutdown (Potion *P, PN cl, PN stream, PN req, PN cb) |
static PN | aio_write (Potion *P, PN cl, PN stream, PN req, PN buf, PN bufcnt, PN cb) |
static PN | aio_listen (Potion *P, PN cl, PN stream, PN backlog, PN cb) |
static PN | aio_accept (Potion *P, PN cl, PN stream, PN client) |
static PN | aio_read_start (Potion *P, PN cl, PN self, PN cb) |
static PN | aio_read_stop (Potion *P, PN cl, PN self) |
static PN | aio_write2 (Potion *P, PN cl, PN stream, PN req, PN buf, PN bufcnt, PN send_handle, PN cb) |
static PN | aio_is_readable (Potion *P, PN cl, PN stream) |
static PN | aio_is_writable (Potion *P, PN cl, PN stream) |
static PN | aio_is_closing (Potion *P, PN cl, PN stream) |
create a Aio_stream
This call is used in conjunction with listen() to accept incoming connections. Call uv_accept after receiving a uv_connection_cb to accept the connection.
When the uv_connection_cb is called it is guaranteed that uv_accept will complete successfully the first time. If you attempt to use it more than once, it may fail. It is suggested to only call uv_accept once per uv_connection_cb call.
Read data from an incoming stream. The callback will be made several times until there is no more data to read or read_stop is called. When we've reached EOF nread will be set to -1 and the error is set to UV_EOF. When nread == -1 the buf parameter might not point to a valid buffer; in that case buf.len and buf.base are both set to 0. Note that nread might also be 0, which does not indicate an error or eof; it happens when aio requested a buffer through the alloc callback but then decided that it didn't need that buffer.
static PN aio_write2 | ( | Potion * | P, |
PN | cl, | ||
PN | stream, | ||
PN | req, | ||
PN | buf, | ||
PN | bufcnt, | ||
PN | send_handle, | ||
PN | cb | ||
) |
Extended write function for sending handles over a pipe. The pipe must be initialized with ipc == 1. send_handle must be a TCP socket or pipe, which is a server or a connection (listening or connected state). Bound sockets or pipes will be assumed to be servers.