Home --> Documentations --> PJLIB Reference
Data Fields |
pj_bool_t(* | on_data_read )(pj_ssl_sock_t *ssock, void *data, pj_size_t size, pj_status_t status, pj_size_t *remainder) |
pj_bool_t(* | on_data_recvfrom )(pj_ssl_sock_t *ssock, void *data, pj_size_t size, const pj_sockaddr_t *src_addr, int addr_len, pj_status_t status) |
pj_bool_t(* | on_data_sent )(pj_ssl_sock_t *ssock, pj_ioqueue_op_key_t *send_key, pj_ssize_t sent) |
pj_bool_t(* | on_accept_complete )(pj_ssl_sock_t *ssock, pj_ssl_sock_t *newsock, const pj_sockaddr_t *src_addr, int src_addr_len) |
pj_bool_t(* | on_connect_complete )(pj_ssl_sock_t *ssock, pj_status_t status) |
Detailed Description
This structure contains the callbacks to be called by the secure socket.
Field Documentation
This callback is called when new connection arrives as the result of pj_ssl_sock_start_accept().
- Parameters:
-
| ssock | The secure socket. |
| newsock | The new incoming secure socket. |
| src_addr | The source address of the connection. |
| addr_len | Length of the source address. |
- Returns:
- PJ_TRUE if further accept() is desired, and PJ_FALSE when application no longer wants to accept incoming connection. Application may destroy the secure socket in the callback and return PJ_FALSE here.
This callback is called when pending connect operation has been completed.
- Parameters:
-
| ssock | The secure socket. |
| status | The connection result. If connection has been successfully established, the status will contain PJ_SUCCESS. |
- Returns:
- Application may destroy the secure socket in the callback and return PJ_FALSE here.
This callback is called when a data arrives as the result of pj_ssl_sock_start_read().
- Parameters:
-
| ssock | The secure socket. |
| data | The buffer containing the new data, if any. If the status argument is non-PJ_SUCCESS, this argument may be NULL. |
| size | The length of data in the buffer. |
| status | The status of the read operation. This may contain non-PJ_SUCCESS for example when the TCP connection has been closed. In this case, the buffer may contain left over data from previous callback which the application may want to process. |
| remainder | If application wishes to leave some data in the buffer (common for TCP applications), it should move the remainder data to the front part of the buffer and set the remainder length here. The value of this parameter will be ignored for datagram sockets. |
- Returns:
- PJ_TRUE if further read is desired, and PJ_FALSE when application no longer wants to receive data. Application may destroy the secure socket in the callback and return PJ_FALSE here.
This callback is called when a packet arrives as the result of pj_ssl_sock_start_recvfrom().
- Parameters:
-
| ssock | The secure socket. |
| data | The buffer containing the packet, if any. If the status argument is non-PJ_SUCCESS, this argument will be set to NULL. |
| size | The length of packet in the buffer. If the status argument is non-PJ_SUCCESS, this argument will be set to zero. |
| src_addr | Source address of the packet. |
| addr_len | Length of the source address. |
| status | This contains |
- Returns:
- PJ_TRUE if further read is desired, and PJ_FALSE when application no longer wants to receive data. Application may destroy the secure socket in the callback and return PJ_FALSE here.
This callback is called when data has been sent.
- Parameters:
-
| ssock | The secure socket. |
| send_key | Key associated with the send operation. |
| sent | If value is positive non-zero it indicates the number of data sent. When the value is negative, it contains the error code which can be retrieved by negating the value (i.e. status=-sent). |
- Returns:
- Application may destroy the secure socket in the callback and return PJ_FALSE here.
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.
|