Paraslash Audio Streaming | |
About News Download Documentation Development |
Common functions of para_client and para_audiod. More...
#include <netinet/in.h>
#include <sys/socket.h>
#include <regex.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <sys/un.h>
#include <netdb.h>
#include <lopsub.h>
#include "client.lsg.h"
#include "para.h"
#include "error.h"
#include "list.h"
#include "lsu.h"
#include "sched.h"
#include "crypt.h"
#include "net.h"
#include "fd.h"
#include "sideband.h"
#include "string.h"
#include "client.h"
#include "buffer_tree.h"
#include "version.h"
Macros | |
#define | CLIENT_BUFSIZE 4000 |
The size of the receiving buffer. More... | |
Functions | |
void | client_close (struct client_task *ct) |
Close the connection to para_server and free all resources. More... | |
int | client_connect (struct client_task *ct, struct sched *s, struct btr_node *parent, struct btr_node *child) |
Connect to para_server and register the client task. More... | |
int | client_parse_config (int argc, char *argv[], struct client_task **ct_ptr, int *loglevel) |
Parse a client configuration. More... | |
int | client_open (int argc, char *argv[], struct client_task **ct_ptr, int *loglevel, struct btr_node *parent, struct btr_node *child, struct sched *sched) |
Parse the client configuration and open a connection to para_server. More... | |
Common functions of para_client and para_audiod.
#define CLIENT_BUFSIZE 4000 |
The size of the receiving buffer.
void client_close | ( | struct client_task * | ct | ) |
Close the connection to para_server and free all resources.
ct | Pointer to the client data. |
int client_connect | ( | struct client_task * | ct, |
struct sched * | s, | ||
struct btr_node * | parent, | ||
struct btr_node * | child | ||
) |
Connect to para_server and register the client task.
ct | The initialized client task structure. |
s | The scheduler instance to register the client task to. |
parent | The parent node of the client btr node. |
child | The child node of the client node. |
The client task structure given by ct must be allocated and initialized by client_parse_config() before this function is called.
int client_parse_config | ( | int | argc, |
char * | argv[], | ||
struct client_task ** | ct_ptr, | ||
int * | loglevel | ||
) |
Parse a client configuration.
argc | Usual argument count. |
argv | Usual argument vector. |
ct_ptr | Filled in by this function. |
loglevel | If not NULL , the number of the loglevel is stored here. |
This checks the command line options given by argc and argv, sets default values for the user name and the name of the rsa key file and reads further options from the config file.
Upon successful return, ct_ptr points to a dynamically allocated and initialized client task struct.
Referenced by main().
int client_open | ( | int | argc, |
char * | argv[], | ||
struct client_task ** | ct_ptr, | ||
int * | loglevel, | ||
struct btr_node * | parent, | ||
struct btr_node * | child, | ||
struct sched * | sched | ||
) |
Parse the client configuration and open a connection to para_server.
argc | See client_parse_config. |
argv | See client_parse_config. |
ct_ptr | See client_parse_config. |
loglevel | See client_parse_config. |
parent | See client_connect(). |
child | See client_connect(). |
sched | See client_connect(). |
This function combines client_parse_config() and client_connect(). It is considered a syntax error if no command was given, i.e. if the number of non-option arguments is zero.