WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJLIB Reference

#include <ioqueue.h>

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

◆ on_accept_complete

void(* pj_ioqueue_callback::on_accept_complete) (pj_ioqueue_key_t *key, pj_ioqueue_op_key_t *op_key, pj_sock_t sock, pj_status_t status)

This callback is called when pj_ioqueue_accept completes.

Parameters
keyThe key.
op_keyOperation key.
sockNewly connected socket.
statusZero if the operation completes successfully.

◆ on_connect_complete

void(* pj_ioqueue_callback::on_connect_complete) (pj_ioqueue_key_t *key, pj_status_t status)

This callback is called when pj_ioqueue_connect completes.

Parameters
keyThe key.
statusPJ_SUCCESS if the operation completes successfully.

◆ on_read_complete

void(* pj_ioqueue_callback::on_read_complete) (pj_ioqueue_key_t *key, pj_ioqueue_op_key_t *op_key, pj_ssize_t bytes_read)

This callback is called when pj_ioqueue_recv or pj_ioqueue_recvfrom completes.

Parameters
keyThe key.
op_keyOperation 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).

◆ on_write_complete

void(* pj_ioqueue_callback::on_write_complete) (pj_ioqueue_key_t *key, pj_ioqueue_op_key_t *op_key, pj_ssize_t bytes_sent)

This callback is called when pj_ioqueue_send or pj_ioqueue_sendto completes.

Parameters
keyThe key.
op_keyOperation key.
bytes_sent>= 0 to indicate the amount of data written, otherwise negative value containing the error code. To obtain the pj_status_t error code, use (pj_status_t code = -bytes_sent).

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.