8 return time.strftime("%Y-%m-%d %H:%M:%S");
11 config = ConfigParser.ConfigParser()
12 config.read("stream.conf")
14 media_plugin = config.get("Media", "engine")
15 exec("from plugins.media.%s import *" % media_plugin)
19 comm_plugin = config.get("Comm", "engine")
20 exec("from plugins.comm.%s import *" % comm_plugin)
23 server = Server(config)
25 print "--> Starting the server..."
27 while (server.finish == 0):
28 con, client = server.getRequest()
31 msg = server.getMsg(1024).strip()
35 elif (msg == "SETUP"):
36 setup = server.getMsg(1024).strip().split(" ")
37 media.setup(setup[0], setup[1], setup[2], \
38 setup[3], setup[4], setup[5],
39 setup[6], setup[7], setup[8],
48 elif (msg == "CLOSE"):
53 print "[%s] %s: %s" % (now(), client, msg)
55 print "[%s] Closing connection with %s" % (now(), client)
56 server.disconnect_client(con)
60 print "--> Server stopped..."