#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
#include <mvp_refmem.h>
#include <cmyth.h>
#include <cmyth_local.h>
Go to the source code of this file.
Functions | |
| static void | cmyth_conn_destroy (cmyth_conn_t conn) |
| static cmyth_conn_t | cmyth_conn_create (void) |
| static void | sighandler (int sig) |
| static cmyth_conn_t | cmyth_connect (char *server, unsigned short port, unsigned buflen, int tcp_rcvbuf) |
| static cmyth_conn_t | cmyth_conn_connect (char *server, unsigned short port, unsigned buflen, int tcp_rcvbuf, int event) |
| cmyth_conn_t | cmyth_conn_connect_ctrl (char *server, unsigned short port, unsigned buflen, int tcp_rcvbuf) |
| Create a control connection to a backend. | |
| cmyth_conn_t | cmyth_conn_connect_event (char *server, unsigned short port, unsigned buflen, int tcp_rcvbuf) |
| Create an event connection to a backend. | |
| cmyth_file_t | cmyth_conn_connect_file (cmyth_proginfo_t prog, cmyth_conn_t control, unsigned buflen, int tcp_rcvbuf) |
| Create a file connection to a backend. | |
| int | cmyth_conn_connect_ring (cmyth_recorder_t rec, unsigned buflen, int tcp_rcvbuf) |
| Create a ring buffer connection to a recorder. | |
| int | cmyth_conn_connect_recorder (cmyth_recorder_t rec, unsigned buflen, int tcp_rcvbuf) |
| Create a connection to a recorder. | |
| int | cmyth_conn_check_block (cmyth_conn_t conn, unsigned long size) |
| Check whether a block has finished transfering from a backend. | |
| cmyth_recorder_t | cmyth_conn_get_recorder_from_num (cmyth_conn_t conn, int id) |
| Obtain a recorder from a connection by its recorder number. | |
| cmyth_recorder_t | cmyth_conn_get_free_recorder (cmyth_conn_t conn) |
| Obtain the next available free recorder on a backend. | |
| int | cmyth_conn_get_freespace (cmyth_conn_t control, long long *total, long long *used) |
| Get the amount of free disk space on a backend. | |
| int | cmyth_conn_hung (cmyth_conn_t control) |
| Determine if a control connection is not responding. | |
| int | cmyth_conn_get_protocol_version (cmyth_conn_t conn) |
| Determine the MythTV protocol version being used. | |
| int | cmyth_conn_get_free_recorder_count (cmyth_conn_t conn) |
| Determine the number of free recorders. | |
Variables | |
| pthread_mutex_t | mutex = PTHREAD_MUTEX_INITIALIZER |
| static char | my_hostname [128] |
| static volatile cmyth_socket_t | my_fd |
Definition in file connection.c.
|
||||||||||||
|
Check whether a block has finished transfering from a backend.
Definition at line 690 of file connection.c. References cmyth_dbg(), CMYTH_DBG_DEBUG, CMYTH_DBG_ERROR, cmyth_rcv_length, cmyth_rcv_ulong, cmyth_conn::conn_fd, and errno. |
|
||||||||||||||||||||||||
|
Definition at line 292 of file connection.c. References cmyth_connect(), cmyth_dbg(), CMYTH_DBG_ERROR, CMYTH_DBG_PROTO, cmyth_rcv_okay, cmyth_rcv_version, cmyth_send_message, cmyth_conn::conn_version, my_hostname, and ref_release(). Referenced by cmyth_conn_connect_ctrl(), and cmyth_conn_connect_event(). |
|
||||||||||||||||||||
|
Create a control connection to a backend.
Definition at line 384 of file connection.c. References cmyth_conn_connect(), cmyth_dbg(), and CMYTH_DBG_PROTO. Referenced by cmyth_conn_connect_recorder(), mythtv_init(), and mythtv_open(). |
|
||||||||||||||||||||
|
Create an event connection to a backend.
Definition at line 399 of file connection.c. References cmyth_conn_connect(), cmyth_dbg(), and CMYTH_DBG_PROTO. Referenced by mythtv_init(). |
|
||||||||||||||||||||
|
Create a file connection to a backend.
Definition at line 434 of file connection.c. References cmyth_connect(), cmyth_dbg(), CMYTH_DBG_ERROR, CMYTH_DBG_PROTO, cmyth_file_create, cmyth_rcv_length, cmyth_rcv_long, cmyth_rcv_string, cmyth_rcv_u_long_long, cmyth_send_message, cmyth_conn::conn_version, control, cmyth_file::file_data, cmyth_file::file_id, cmyth_file::file_length, my_hostname, cmyth_proginfo::proginfo_host, cmyth_proginfo::proginfo_pathname, cmyth_proginfo::proginfo_port, ref_hold(), and ref_release(). Referenced by cmyth_livetv_chain_setup(), cmyth_livetv_chain_update(), and mythtv_open(). |
|
||||||||||||||||
|
Create a connection to a recorder.
Definition at line 636 of file connection.c. References cmyth_conn_connect_ctrl(), cmyth_dbg(), CMYTH_DBG_ERROR, CMYTH_DBG_PROTO, port, cmyth_recorder::rec_conn, cmyth_recorder::rec_port, cmyth_recorder::rec_server, and ref_release(). Referenced by cmyth_conn_get_free_recorder(), and cmyth_conn_get_recorder_from_num(). |
|
||||||||||||||||
|
Create a ring buffer connection to a recorder.
Definition at line 574 of file connection.c. References cmyth_connect(), cmyth_dbg(), CMYTH_DBG_ERROR, CMYTH_DBG_PROTO, CMYTH_LONG_LEN, cmyth_rcv_okay, cmyth_send_message, cmyth_ringbuf::conn_data, my_hostname, port, cmyth_recorder::rec_id, cmyth_recorder::rec_port, cmyth_recorder::rec_ring, cmyth_recorder::rec_server, and ref_release(). |
|
|
Definition at line 95 of file connection.c. References cmyth_conn_destroy(), cmyth_dbg(), CMYTH_DBG_DEBUG, ref_alloc, and ref_set_destroy(). Referenced by cmyth_connect(). |
|
|
Definition at line 58 of file connection.c. References closesocket, cmyth_dbg(), CMYTH_DBG_DEBUG, CMYTH_DBG_PROTO, cmyth_conn::conn_buf, and cmyth_conn::conn_fd. Referenced by cmyth_conn_create(). |
|
|
Obtain the next available free recorder on a backend.
Definition at line 856 of file connection.c. References cmyth_conn_connect_recorder(), cmyth_dbg(), CMYTH_DBG_ERROR, cmyth_rcv_length, cmyth_rcv_long, cmyth_rcv_string, cmyth_recorder_create(), cmyth_send_message, cmyth_conn::conn_buflen, cmyth_conn::conn_tcp_rcvbuf, mutex, port, cmyth_recorder::rec_id, cmyth_recorder::rec_port, cmyth_recorder::rec_server, ref_release(), and ref_strdup(). |
|
|
Determine the number of free recorders.
Definition at line 1054 of file connection.c. References cmyth_dbg(), CMYTH_DBG_ERROR, cmyth_rcv_length, cmyth_rcv_long, cmyth_send_message, and mutex. Referenced by mythtv_livetv_start(), and mythtv_new_livetv(). |
|
||||||||||||||||
|
Get the amount of free disk space on a backend.
Definition at line 939 of file connection.c. References cmyth_dbg(), CMYTH_DBG_ERROR, cmyth_rcv_length, cmyth_rcv_long_long, cmyth_rcv_string, cmyth_send_message, cmyth_conn::conn_version, control, and mutex. Referenced by mythtv_update(). |
|
|
Determine the MythTV protocol version being used.
Definition at line 1041 of file connection.c. References cmyth_dbg(), CMYTH_DBG_ERROR, and cmyth_conn::conn_version. Referenced by cmyth_event_get(), mythtv_livetv_menu_start(), mythtv_schedule_recording(), and prog_finder_time_callback(). |
|
||||||||||||
|
Obtain a recorder from a connection by its recorder number.
Definition at line 760 of file connection.c. References cmyth_conn_connect_recorder(), cmyth_dbg(), CMYTH_DBG_ERROR, cmyth_rcv_length, cmyth_rcv_long, cmyth_rcv_string, cmyth_recorder_create(), cmyth_send_message, cmyth_conn::conn_buflen, cmyth_conn::conn_tcp_rcvbuf, mutex, port, cmyth_recorder::rec_id, cmyth_recorder::rec_port, cmyth_recorder::rec_server, ref_release(), and ref_strdup(). Referenced by get_livetv_programs_rec(), myth_tvguide_get_free_cardids(), mythtv_livetv_start(), and mythtv_new_livetv(). |
|
|
Determine if a control connection is not responding.
Definition at line 1032 of file connection.c. References cmyth_conn::conn_hang, and control. Referenced by wd_start(). |
|
||||||||||||||||||||
|
Definition at line 153 of file connection.c. References closesocket, cmyth_conn_create(), cmyth_dbg(), CMYTH_DBG_ERROR, CMYTH_DBG_PROTO, cmyth_conn::conn_buf, cmyth_conn::conn_buflen, cmyth_conn::conn_fd, cmyth_conn::conn_len, cmyth_conn::conn_pos, cmyth_conn::conn_tcp_rcvbuf, cmyth_conn::conn_version, errno, fd, my_fd, my_hostname, ref_release(), sighandler(), and SOCK_STREAM. Referenced by cmyth_conn_connect(), cmyth_conn_connect_file(), and cmyth_conn_connect_ring(). |
|
|
Definition at line 143 of file connection.c. References closesocket, and my_fd. |
|
|
Definition at line 40 of file connection.c. |
|
|
Definition at line 140 of file connection.c. Referenced by cmyth_connect(), and sighandler(). |
|
|
Definition at line 139 of file connection.c. Referenced by cmyth_conn_connect(), cmyth_conn_connect_file(), cmyth_conn_connect_ring(), and cmyth_connect(). |
1.4.6