Req Extract the WebServer to it's own process (application)
#1
Hi there.

True, I know that the subject is a bit far fetched, but there is a idea behind it.

With Current (and others as well) Windows Gotham 13.1 XBMC version, there is a RPC-JSON server running inside the XMBC system, serving i.e. remote control applications on a phone or some other peer. This is so great, but It requires the XBMC application running, naturally. When XMBC is terminated, web server dies ofcoure.

So, can there be (in the future) a separate, extracted application that listens the settings given port and THEN checks if the XBMC it self must be launched in order to have the library read or so...

Smile
Reply
#2
You mean like a helper app to launch XBMC if it isn't already running, and have that also work over JSON-RPC?
Reply
#3
No need. Just use curl to call the json-rpc. If you get a response, XBMC is running.

Stick it in a batch file. You could even have scheduler call the batch file at intervals to see if XBMC is up, and start it if not.

EG
Code:
curl -s -m 1 --max-time 2 --head http://127.0.0.1:9001/jsonrpc
Response from a running instance is
Quote:HTTP/1.1 200 OK
Content-Length: 194608
Content-Type: application/json
Date: Sat, 09 Aug 2014 12:15:57 GMT

If the output from curl is null, XBMC isn't running.
Learning Linux the hard way !!
Reply
#4
Hi there.
Well, you have got it wrong...
The idea was to have seperate service application that listens the Rest calls and then check if the XBMC should be launched and the transmission delievered (full reverse proxy) to it..

Actually, this is quite easy Windows .net 4.x project for Vistual Studio.
* created service application listens to port 80 and checks on every http call to it if the actual Xbmc instance is running (socket check for Xbmc's webserver port). If Xbmc does not anser, xbmc is launched (registry lookup for installed dir and -p for portable if needed).
* Xbmc is not altered in any way, but the WebServer inside listens different port, e.g. 81.
* All calls are proxied by the created service to Xbmc.

With this small UI less solution, phone remote controll apps can truly be used, despite Xbmc was not running at the moment.
Reply
#5
...actually.. I withdraw this... service should register to the same port as xbmc as a listener if the center isn't running and then disattach when xbmc comes online and this produces complexity too far.

I just use a PHP page to check if xbmc answers to socket level and then start it on my WebServer if needed. (same machine as Xbmc).
Reply
#6
Hi are you bringing the inbetweeners movie 2 out to xbmc?
Reply

Logout Mark Read Team Forum Stats Members Help
Extract the WebServer to it's own process (application)0