BLOG | DOCUMENTATION | TRAC

Home --> Documentations --> PJLIB Reference

pj_ioqueue_callback Struct Reference
[IOQueue: I/O Event Dispatching with Proactor Pattern]

Data Fields

void(* on_read_complete )(pj_ioqueue_key_t *key, pj_ioqueue_op_key_t *op_key, pj_ssize_t bytes_read)
void(* on_write_complete )(pj_ioqueue_key_t *key, pj_ioqueue_op_key_t *op_key, pj_ssize_t bytes_sent)
void(* on_accept_complete )(pj_ioqueue_key_t *key, pj_ioqueue_op_key_t *op_key, pj_sock_t sock, pj_status_t status)
void(* on_connect_complete )(pj_ioqueue_key_t *key, pj_status_t status)

Detailed Description

This structure describes the callbacks to be called when I/O operation completes.


Field Documentation

This callback is called when pj_ioqueue_recv or pj_ioqueue_recvfrom completes.

Parameters:
key The key.
op_key Operation key.
bytes_read >= 0 to indicate the amount of data read, otherwise negative value containing the error code. To obtain the pj_status_t error code, use (pj_status_t code = -bytes_read).

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

 


PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.