]>
git.zerfleddert.de Git - record-dvb/blob - dump-stream.c
1cbaad260854656b6aedc32699b8d476e28e411a
6 #include <sys/socket.h>
15 #define CHUNKSIZE 1500
17 int main(int argc
, char **argv
)
20 int bytes
, written
, i
;
22 char buffer
[CHUNKSIZE
];
27 fprintf(stderr
,"Syntax: %s URL\n", argv
[0]);
31 if ((in
= open_mcast(url
)) < 0) {
32 fprintf(stderr
,"Can't open url %s!\n",url
);
37 if ((bytes
= recv(in
, buffer
, CHUNKSIZE
, 0)) < 1) {
44 if ((i
= write(STDOUT_FILENO
, buffer
, bytes
-written
)) < 0) {
49 } while(written
< bytes
);