p2  0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Aio_stream Class Reference

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)
 

Detailed Description

create a Aio_stream

Member Function Documentation

static PN aio_shutdown ( Potion P,
PN  cl,
PN  stream,
PN  req,
PN  cb 
)

Definition at line 1245 of file aio.c.

static PN aio_write ( Potion P,
PN  cl,
PN  stream,
PN  req,
PN  buf,
PN  bufcnt,
PN  cb 
)

PNString buf TODO: buf should be PNBytes, not PNData wrapping uv_buf_t

Definition at line 1258 of file aio.c.

static PN aio_listen ( Potion P,
PN  cl,
PN  stream,
PN  backlog,
PN  cb 
)

Definition at line 1272 of file aio.c.

static PN aio_accept ( Potion P,
PN  cl,
PN  stream,
PN  client 
)

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.

Definition at line 1289 of file aio.c.

static PN aio_read_start ( Potion P,
PN  cl,
PN  self,
PN  cb 
)

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.

Definition at line 1306 of file aio.c.

static PN aio_read_stop ( Potion P,
PN  cl,
PN  self 
)

Definition at line 1314 of file aio.c.

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.

Definition at line 1327 of file aio.c.

static PN aio_is_readable ( Potion P,
PN  cl,
PN  stream 
)
Returns
PNBoolean

Definition at line 1343 of file aio.c.

static PN aio_is_writable ( Potion P,
PN  cl,
PN  stream 
)
Returns
PNBoolean

Definition at line 1350 of file aio.c.

static PN aio_is_closing ( Potion P,
PN  cl,
PN  stream 
)

Used to determine whether a stream is closing or closed.

N.B. is only valid between the initialization of the handle and the arrival of the close callback, and cannot be used to validate the handle.

Returns
PNBoolean

Definition at line 1362 of file aio.c.


The documentation for this class was generated from the following file: