An app without GUI

D

Daniel Crespo

Hello to all,

I have to build a server app without GUI. This app must be an xml-rpc
server, so it has to be up all the time. I would control it through the
xml-rpc port from a web interface using php, sending parameters to
defined xml-rpc functions for running certain processes, like viewing
current connections, restart it or shutting it down, for example.

Actually, I have it implemented with wxPython. The GUI controls when
the xml-rpc server is running, so when I close the GUI, so does the
server and all the dependent threads.

I want to do something like the MainLoop(), but without GUI. I can sit
down and build all this stuff, but I would like to know if someone had
passed through this. Any tips?

Thanks

Daniel
 
J

jmdeschamps

Daniel said:
Hello to all,

I have to build a server app without GUI. This app must be an xml-rpc
server, so it has to be up all the time. I would control it through the
xml-rpc port from a web interface using php, sending parameters to
defined xml-rpc functions for running certain processes, like viewing
current connections, restart it or shutting it down, for example.

Actually, I have it implemented with wxPython. The GUI controls when
the xml-rpc server is running, so when I close the GUI, so does the
server and all the dependent threads.

I want to do something like the MainLoop(), but without GUI. I can sit
down and build all this stuff, but I would like to know if someone had
passed through this. Any tips?

Thanks

Daniel
here is complete example - some words in french
note: this will open a dos box for std IO
#*********************************************************************************
# -*- encoding: iso-8859-1 -*-
import os
import SimpleXMLRPCServer
import xmlrpclib

class mainServeur(object):
""" going to be the servicing object"""
def __init__(self):
pass

def testServeur(self):
return "i am a server"

monPort = 4089 # whatever
server = SimpleXMLRPCServer.SimpleXMLRPCServer(("127.0.0.1", monPort))

def kill():
global quit
quit = 1
return "i am a dying server"

# Globales
quit = 0
activeController= mainServeur()

server.register_instance(activeController)
server.register_function(kill)

#Go into the main listener loop
print "llistening on port ",monPort
while not quit :
server.handle_request()
#**********************************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,276
Messages
2,571,384
Members
48,073
Latest member
ImogenePal

Latest Threads

Top