]>
cvs.zerfleddert.de Git - record-dvb/blob - dump-stream.c
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
);