示例#1
0
void msgNewChapter( NetMessage *msg, const char *title, double startTime, double duration, BOOL absolute )
{
	MSGINIT( msg, NewChapter, Command );
	strncpy( msg->data.URN, title, sizeof(msg->data.URN) );
	msg->data.URN[sizeof(msg->data.URN)-1] = '\0';
	msg->data.iVal1 = -999;
	msg->data.val1 = startTime;
	msg->data.val2 = duration;
	msg->data.boolean = absolute;
}
示例#2
0
void SendNetErrorNotification( SOCK ss, const char *txt, ErrCode err )
{ NetMessage msg;
	if( ss != NULLSOCKET ){
		MSGINIT( (&msg), Err, Notification );
		if( *txt ){
			strncpy( msg.data.URN, txt, sizeof(msg.data.URN) );
			msg.data.URN[sizeof(msg.data.URN)-1] = '\0';
		}
		msg.data.error = err;
		SendMessageToNet( ss, &msg, SENDTIMEOUT, FALSE, "SendNetErrorNotification" );
	}
}
示例#3
0
void msgGetChapter( NetMessage *msg, int32_t idx )
{
	MSGINIT( msg, GetChapter, Command );
	if( idx < 0 ){
		strcpy( msg->data.URN, "<list all>" );
	}
	else{
		strcpy( msg->data.URN, "<in retrieval>" );
	}
	msg->data.iVal1 = idx;
	set_NaN(msg->data.val1);
	set_NaN(msg->data.val2);
	msg->data.boolean = FALSE;
}
示例#4
0
void msgGetLastInterval(NetMessage *msg)
{
	MSGINIT( msg, GetLastInterval, Command );
}
示例#5
0
void msgMarkIntervalTime( NetMessage *msg, BOOL reset )
{
	MSGINIT( msg, MarkIntervalTime, Command );
	msg->data.boolean = reset;
}
示例#6
0
void msgGetStartTime(NetMessage *msg)
{
	MSGINIT( msg, GetStartTime, Command );
}
示例#7
0
void msgGetDuration(NetMessage *msg)
{
	MSGINIT( msg, GetDuration, Command );
}
示例#8
0
void msgGetTime( NetMessage *msg, BOOL absolute )
{
	MSGINIT( msg, GetTime, Command );
	msg->data.boolean = absolute;
}
示例#9
0
void msgGetTimeSubscription( NetMessage *msg, double interval, BOOL absolute )
{
	MSGINIT( msg, GetTimeSubscription, Command );
	msg->data.val1 = interval;
	msg->data.boolean = absolute;
}
示例#10
0
void msgQuitQTVOD(NetMessage *msg)
{
	MSGINIT( msg, Quit, Command );
}
示例#11
0
void msgGotoTime( NetMessage *msg, double t, BOOL absolute )
{
	MSGINIT( msg, GotoTime, Command );
	msg->data.val1 = t;
	msg->data.boolean = absolute;
}
示例#12
0
void msgResetQTVOD( NetMessage *msg, BOOL complete )
{
	MSGINIT( msg, Reset, Command );
	msg->data.boolean = complete;
}
示例#13
0
void msgCloseMovie(NetMessage *msg)
{
	MSGINIT( msg, Close, Command );
}
示例#14
0
void msgStopMovie(NetMessage *msg)
{
	MSGINIT( msg, Stop, Command );
}
示例#15
0
void msgPlayMovie(NetMessage *msg)
{
	MSGINIT( msg, Start, Command );
}
示例#16
0
int
main( int ac, char* av[] )
{
	int	j;
	int	Ret;
	char	*pCell, *pPath, *pRas;
	int	Fd;
	int	Len;

	if( ac < 4 ) {
		usage();
		exit( -1 );
	}
	pCell	= av[1];
	j 		= atoi( av[2] );
	pRas	= av[3];
	pPath	= av[4];

	Fd	= ConnectAdmPort( pCell, j );
	if( Fd < 0 ) {
		printf("No AdmPort[%s_%d]\n", pCell, j );
		goto err;
	}
/*
 *	send RAS command
 */
	PaxosSessionHead_t	Any;

	MSGINIT( &Any, PAXOS_SESSION_ANY, 0, sizeof(Any)+sizeof(PFSRASReq_t));
	Ret = SendStream( Fd, (char*)&Any, sizeof(Any) );
	if( Ret ) {
		printf("ERR:SendStream[%s_%d] ANY\n", pCell, j );
		goto err1;
	}

	PFSRASReq_t	Req;
	PFSRASRpl_t	Rpl;

	memset( &Req, 0, sizeof(Req));

	MSGINIT( &Req, PFS_RAS, 0, sizeof(Req) );
	strncpy( Req.r_Cell, pRas, sizeof(Req.r_Cell) );
	strncpy( Req.r_Path, pPath, sizeof(Req.r_Path) );

	Ret = SendStream( Fd, (char*)&Req, sizeof(Req) );
	if( Ret ) {
		printf("ERR:SendStream[%s_%d]\n", pCell, j );
		goto err1;
	}
	Len	= sizeof(Rpl);
	Ret = RecvStream( Fd, (char*)&Rpl, Len );
	if( Ret ) {
		printf("ERR:RecvStream[%s_%d]\n", pCell, j );
		goto err1;
	}
	if( Rpl.r_Head.h_Error ) {
		errno = Rpl.r_Head.h_Error;
		perror(" ");
	}
	close( Fd );
	exit( 0 );
err1:
	close( Fd );
err:
	exit( -1 );
}