X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=send.h;h=69ebd377e0ea27c46932a1a1e5456349e9787360;hp=94d8afd82e1c40bbacfdbf501c951e08551362d4;hb=cd8bb5a2d51179a31842a2cd7012cad28deea78d;hpb=8268a10edbdbb77d9e1b82a27dcc5b2b465412d1 diff --git a/send.h b/send.h index 94d8afd8..69ebd377 100644 --- a/send.h +++ b/send.h @@ -87,3 +87,24 @@ struct sender { */ int (*client_cmds[NUM_SENDER_CMDS])(struct sender_command_data*); }; + +/** Describes one client, connected to a paraslash sender. */ +struct sender_client { + /** The file descriptor of the client. */ + int fd; + /** The socket "name" of the client. */ + char *name; + /** The position of this client in the client list. */ + struct list_head node; + /** Non-zero if audio file header has been sent. */ + int header_sent; + /** The list of pending chunks for this client. */ + struct chunk_queue *cq; + /** Data specific to the particular sender. */ + void *private_data; +}; + +int open_sender(unsigned l4type, int port); +void shutdown_client(struct sender_client *sc); +void send_chunk(struct sender_client *sc, size_t max_bytes_per_write, + long unsigned current_chunk, const char *buf, size_t len);