Telenet program error

Discussion about configuration and usage of VLM (a stream scheduler) within VLC.
WindyBUPT
New Cone
New Cone
Posts: 3
Joined: 13 Apr 2006 17:16

Telenet program error

Postby WindyBUPT » 07 May 2006 06:56

I want to use VLM via my own program.
the following codes get a error:
-------------------------------------------------------------------------
#include<stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#define SERVPORT 4212

main(int argc, char *argv[]){
int sockfd;
struct hostent *host;
struct sockaddr_in serv_addr;
char *init[]={"admin\r",
"new channel1 broadcast enabled\r",
"setup channel1 input /download/test.avi\r",
"setup channel1 output #standard{mux=ts,access=udp,url="."127.0.0.1".",sap,name=\"Channel 1\"}\r",
"control channel1 play\r"};
int t;
if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1){
perror("socket error");
exit(1);
}
serv_addr.sin_family=AF_INET;
serv_addr.sin_port=htons(SERVPORT);
inet_aton("127.0.0.1",&serv_addr.sin_addr);
bzero(&(serv_addr.sin_zero),8);
if (connect(sockfd, (struct sockaddr *)&serv_addr,sizeof(struct sockaddr))==-1){perror("connect error");
exit(1);
}
for(t=0;t<5;t++)
{
send(sockfd,init[t],strlen(init[t]),0);
sleep(1);
}
close(sockfd);
}
--------------------------------------------------------------------
developing......

WindyBUPT
New Cone
New Cone
Posts: 3
Joined: 13 Apr 2006 17:16

Postby WindyBUPT » 07 May 2006 07:01

I open a telnet interface with "vlc -I telnet"

when I run my program,it said that "connection refused"

why ?

PS:I use this program to RC interface,and it worked well.
developing......


Return to “VLM”

Who is online

Users browsing this forum: No registered users and 8 guests