[mythtv] Querying a MythBackend...

Dan Man danman at dtconnect.com
Thu Mar 13 20:40:54 EST 2003


Thanks for the info.

I replied to Pete off list, but the reasons that I can't install PHP are
political and that's what I have to live with. 

I'll be happy to share the code if anyone's interested.....

............................................
Dan Mount
dmount at dtconnect.com


-----Original Message-----
From: Bruce Markey [mailto:bjm at lvcm.com] 
Sent: Thursday, March 13, 2003 8:17 PM
To: Development of mythtv
Subject: Re: [mythtv] Querying a MythBackend...

Dan Man wrote:
> My only public web server that can access my MythTV machines is a
> Windows box. I'm working on creating an object that can query the Myth
> boxen in a fashion similar to MythWeb. (I can not install PHP on this
> server). I've written the code to do TCP communications, for instance
I
> can connect to a web server and retrieve a web page. Now I'm trying to
> understand the syntax of communicating with a Myth box. Looking at
> MythWeb I'm looking up the MasterServerIP and MasterServerPort and
> connecting to it successfully, but my queries never return.
> 
> My questions are:
> 
> I see that queries need to be formatted as QueryLength + 8 spaces +
> query. Is that correct?

Almost. It's an 8 byte field with an ASCII int string for
the content length of the message that follows the 8 bytes.
So a 16 byte message would have "1", "6", six spaces then 16
bytes and no terminator for a total of 24 bytes.

> Does anything need to be sent to the back end before queries can
happen?

Connect and send an "ANN ..." to announce your arrival.

> Am I correct in using < MasterServerIP and MasterServerPort?

Yes.

> Any pointers here?

1) I agree with Pete, don't reinvent the wheel ;-).

2) Uncomment cerr << payload in MC/libs/libmyth/util.cpp to
see the control socket messages printed to your terminal.

--  bjm

_______________________________________________
mythtv-dev mailing list
mythtv-dev at snowman.net
http://www.snowman.net/mailman/listinfo/mythtv-dev



More information about the mythtv-dev mailing list