Posts: 58
Joined: Apr 2004
Reputation:
0
i'm wanting to add a socket service into xbmc and am wondering if i can do so via the python interface. i will want it to be running in the background at all times listening on a socket and answering requests. preferably i would not want the user to have to kick it off. is this possible, if so are there any examples out there for me to look at?
thanks,
tim
Posts: 707
Joined: Jul 2004
Reputation:
6
hi
you can use socket library. it works on xbox and you sohould find many example all over the internet... ask your friend, google, it should find you some answers
Posts: 58
Joined: Apr 2004
Reputation:
0
i realize there is the socket support i need. what i'm asking is if there is a way to have the script 'auto-run' in the background without user intervention and therefor to act as a server. in other words i wish to design a service that runs in the background and has no user interaction from the xbox console.
Posts: 7,172
Joined: Dec 2003
Reputation:
4
kraqh3d
Retired Developer
Posts: 7,172
only autoexec.py is supported. i think you could have autoexec.py run additional scripts then, but im not sure.
Posts: 707
Joined: Jul 2004
Reputation:
6
autoexec.py is made to launch when your xbmc is loading.
you can try to add som lines :
xbmc.executescript('script.py')
xbmc.executescript('script2.py')
xbmc.executescript('script3.py')
...
but this will only run scripts one after the others...
maybe could it be possible using threading, to run several scripts at the same time (might be tricky for a beginner i think...)
Posts: 58
Joined: Apr 2004
Reputation:
0
i suppse you could replace 'autoexec.py' with a script that did an 'xbmc.executescript' for all items within a 'startup' directory or something. the comment in the file states you shouldn't run more than one script at a time that requests user input, which makes sense. i don't see any reason why you couldn't add as many 'server' type scripts as you want however.
i'm well on my way to having my own service running. i hadn't gotten my feet wet in python or the xbmc python bindings until now.
thanks for the help!