8 config = ConfigParser.ConfigParser()
9 config.read("stream.conf")
11 media_plugin = config.get("Media", "engine")
12 exec("from plugins.media.%s import *" % media_plugin)
16 comm_plugin = config.get("Comm", "engine")
17 exec("from plugins.comm.%s import *" % comm_plugin)
20 server = Server(config)
22 lib.log("Starting GMyth-Stream server")
24 while (server.finish == 0):
25 con, client = server.getRequest()
28 msg = server.getMsg(1024).strip()
32 lib.log("Received %s from: %s" % (msg, client) )
35 setup = server.getMsg(1024).strip().split(" ")
36 if ( len(setup) == 10 ):
37 media.setup(setup[0], setup[1], setup[2], \
38 setup[3], setup[4], setup[5],
39 setup[6], setup[7], setup[8],
45 lib.log("Wrong SETUP command from: %s" % client[0])
55 elif (msg == "CLOSE"):
61 lib.log("Closing connection with %s" % client[0])
62 server.disconnect_client(con)
66 lib.log("Server stopped. Closing...")