RTS API Documentation
1.10.11
|
Macros | |
#define | SWITCH_POLLIN 0x001 |
#define | SWITCH_POLLPRI 0x002 |
#define | SWITCH_POLLOUT 0x004 |
#define | SWITCH_POLLERR 0x010 |
#define | SWITCH_POLLHUP 0x020 |
#define | SWITCH_POLLNVAL 0x040 |
Typedefs | |
typedef struct switch_pollfd | switch_pollfd_t |
typedef struct fspr_pollset_t | switch_pollset_t |
#define SWITCH_POLLERR 0x010 |
Pending error
Definition at line 1339 of file switch_apr.h.
Referenced by enable_local_rtcp_socket(), and switch_rtp_set_local_address().
#define SWITCH_POLLHUP 0x020 |
Hangup occurred
Definition at line 1340 of file switch_apr.h.
#define SWITCH_POLLIN 0x001 |
Poll optionsCan read without blocking
Definition at line 1336 of file switch_apr.h.
Referenced by enable_local_rtcp_socket(), and switch_rtp_set_local_address().
#define SWITCH_POLLNVAL 0x040 |
Descriptior invalid
Definition at line 1341 of file switch_apr.h.
#define SWITCH_POLLOUT 0x004 |
Can write without blocking
Definition at line 1338 of file switch_apr.h.
#define SWITCH_POLLPRI 0x002 |
Priority data available
Definition at line 1337 of file switch_apr.h.
typedef struct switch_pollfd switch_pollfd_t |
Poll descriptor set.
Definition at line 1328 of file switch_apr.h.
typedef struct fspr_pollset_t switch_pollset_t |
Opaque structure used for pollset API
Definition at line 1331 of file switch_apr.h.
switch_status_t switch_file_pipe_create | ( | switch_file_t ** | in, |
switch_file_t ** | out, | ||
switch_memory_pool_t * | pool | ||
) |
Create an anonymous pipe.
in | The file descriptor to use as input to the pipe. |
out | The file descriptor to use as output from the pipe. |
pool | The pool to operate on. |
Definition at line 1337 of file switch_apr.c.
switch_status_t switch_file_pipe_timeout_get | ( | switch_file_t * | thepipe, |
switch_interval_time_t * | timeout | ||
) |
Get the timeout value for a pipe or manipulate the blocking state.
thepipe | The pipe we are getting a timeout for. |
timeout | The current timeout value in microseconds. |
Definition at line 1347 of file switch_apr.c.
switch_status_t switch_file_pipe_timeout_set | ( | switch_file_t * | thepipe, |
switch_interval_time_t | timeout | ||
) |
Set the timeout value for a pipe or manipulate the blocking state.
thepipe | The pipe we are setting a timeout on. |
timeout | The timeout value in microseconds. Values < 0 mean wait forever, 0 means do not wait at all. |
Definition at line 1358 of file switch_apr.c.
switch_interval_time_t switch_interval_time_from_timeval | ( | struct timeval * | tvp | ) |
Definition at line 705 of file switch_apr.c.
switch_status_t switch_match_glob | ( | const char * | pattern, |
switch_array_header_t ** | result, | ||
switch_memory_pool_t * | pool | ||
) |
Definition at line 1326 of file switch_apr.c.
switch_status_t switch_os_sock_get | ( | switch_os_socket_t * | thesock, |
switch_socket_t * | sock | ||
) |
Definition at line 712 of file switch_apr.c.
Referenced by msrp_worker().
switch_status_t switch_os_sock_put | ( | switch_socket_t ** | sock, |
switch_os_socket_t * | thesock, | ||
switch_memory_pool_t * | pool | ||
) |
Definition at line 717 of file switch_apr.c.
switch_status_t switch_poll | ( | switch_pollfd_t * | aprset, |
int32_t | numsock, | ||
int32_t * | nsds, | ||
switch_interval_time_t | timeout | ||
) |
Poll the sockets in the poll structure
aprset | The poll structure we will be using. |
numsock | The number of sockets we are polling |
nsds | The number of sockets signalled. |
timeout | The amount of time in microseconds to wait. This is a maximum, not a minimum. If a socket is signalled, we will wake up before this time. A negative number means wait until a socket is signalled. |
Definition at line 1100 of file switch_apr.c.
References SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, and SWITCH_STATUS_TIMEOUT.
Referenced by read_rtp_packet(), rtp_common_read(), and switch_socket_waitfor().
switch_status_t switch_pollset_add | ( | switch_pollset_t * | pollset, |
const switch_pollfd_t * | descriptor | ||
) |
Add a socket or file descriptor to a pollset
pollset | The pollset to which to add the descriptor |
descriptor | The descriptor to add |
Definition at line 1046 of file switch_apr.c.
References SWITCH_STATUS_FALSE.
Referenced by switch_socket_create_pollset().
switch_status_t switch_pollset_create | ( | switch_pollset_t ** | pollset, |
uint32_t | size, | ||
switch_memory_pool_t * | pool, | ||
uint32_t | flags | ||
) |
Setup a pollset object
pollset | The pointer in which to return the newly created object |
size | The maximum number of descriptors that this pollset can hold |
pool | The pool from which to allocate the pollset |
flags | Optional flags to modify the operation of the pollset. |
Definition at line 1041 of file switch_apr.c.
Referenced by switch_socket_create_pollset().
switch_status_t switch_pollset_poll | ( | switch_pollset_t * | pollset, |
switch_interval_time_t | timeout, | ||
int32_t * | num, | ||
const switch_pollfd_t ** | descriptors | ||
) |
Block for activity on the descriptor(s) in a pollset
pollset | The pollset to use |
timeout | Timeout in microseconds |
num | Number of signalled descriptors (output parameter) |
descriptors | Array of signalled descriptors (output parameter) |
Definition at line 1085 of file switch_apr.c.
References SWITCH_STATUS_FALSE, and SWITCH_STATUS_TIMEOUT.
switch_status_t switch_pollset_remove | ( | switch_pollset_t * | pollset, |
const switch_pollfd_t * | descriptor | ||
) |
Remove a descriptor from a pollset
pollset | The pollset from which to remove the descriptor |
descriptor | The descriptor to remove |
Definition at line 1055 of file switch_apr.c.
References SWITCH_STATUS_FALSE.
switch_status_t switch_socket_addr_get | ( | switch_sockaddr_t ** | sa, |
switch_bool_t | remote, | ||
switch_socket_t * | sock | ||
) |
Definition at line 722 of file switch_apr.c.
Referenced by msrp_listener().
switch_status_t switch_socket_create_pollfd | ( | switch_pollfd_t ** | pollfd, |
switch_socket_t * | sock, | ||
int16_t | flags, | ||
void * | client_data, | ||
switch_memory_pool_t * | pool | ||
) |
Create a pollfd out of a socket.
pollfd | the pollfd to create |
sock | the socket to add |
flags | the flags to modify the behaviour |
client_data | custom user data |
pool | the memory pool to use |
Definition at line 1064 of file switch_apr.c.
References memset(), SWITCH_STATUS_FALSE, SWITCH_STATUS_MEMERR, and SWITCH_STATUS_SUCCESS.
Referenced by switch_socket_create_pollset().
switch_status_t switch_socket_create_pollset | ( | switch_pollfd_t ** | poll, |
switch_socket_t * | sock, | ||
int16_t | flags, | ||
switch_memory_pool_t * | pool | ||
) |
Create a set of file descriptors to poll from a socket.
poll | the polfd to create |
sock | the socket to add |
flags | the flags to modify the behaviour |
pool | the memory pool to use |
Definition at line 1117 of file switch_apr.c.
References switch_pollset_add(), switch_pollset_create(), switch_socket_create_pollfd(), SWITCH_STATUS_GENERR, and SWITCH_STATUS_SUCCESS.
Referenced by enable_local_rtcp_socket(), and switch_rtp_set_local_address().
char* switch_strerror | ( | switch_status_t | statcode, |
char * | buf, | ||
switch_size_t | bufsize | ||
) |
Return a human readable string describing the specified error.
statcode | The error code the get a string for. |
buf | A buffer to hold the error string. Size of the buffer to hold the string. |
Definition at line 1440 of file switch_apr.c.
Referenced by msrp_socket_recv(), and msrp_worker().
switch_status_t switch_thread_exit | ( | switch_thread_t * | thd, |
switch_status_t | retval | ||
) |
stop the current thread
thd | The thread to stop |
retval | The return value to pass back to any thread that cares |
Definition at line 1369 of file switch_apr.c.
Referenced by switch_loadable_module_exec().
switch_status_t switch_thread_join | ( | switch_status_t * | retval, |
switch_thread_t * | thd | ||
) |
block until the desired thread stops executing.
retval | The return value from the dead thread. |
thd | The thread to join |
Definition at line 1379 of file switch_apr.c.
References SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, switch_log_printf(), and SWITCH_STATUS_FALSE.
Referenced by do_shutdown(), record_callback(), speech_callback(), switch_core_media_bug_destroy(), switch_core_media_deactivate_rtp(), switch_core_media_set_video_file(), switch_core_memory_stop(), switch_core_sqldb_stop(), switch_event_shutdown(), switch_ivr_deactivate_unicast(), switch_ivr_enterprise_originate(), switch_ivr_originate(), switch_loadable_module_shutdown(), switch_log_shutdown(), switch_msrp_destroy(), switch_nat_thread_stop(), switch_scheduler_task_thread_stop(), and switch_sql_queue_manager_stop().