3 # Rec10 TS Recording Tools
4 # Copyright (C) 2009 Yukikaze
5 from SocketServer import *
11 class Handler(BaseRequestHandler):
13 This is a server to encode ts files in another pc.
17 print "connect from:", self.client_address
19 print cons + " is sent"
20 self.request.send(cons)
22 #ret = self.request.recv(RECV_BUF)
31 tasks = recdb.getnow("1")
34 if task["type"] == recdb.REC_ENCODE_QUE:
40 recdb.del_reckey(recdb.REC_ENCODE_QUE, title, chtxt, btime)
41 recdb.rec_reckey(recdb.REC_ENCODE_GRID, title, chtxt, btime, etime, opt)
42 rett = "title=" + title + "," + "opt=" + opt + ";"
46 port = int(configreader.getpath("gridserver_port"))
47 sv = ThreadingTCPServer(('', port), Handler)
48 print "This is a Rec10 GridServer."
49 print "Waiting for connections at port" + str(port)
50 print 'listen to:', sv.socket.getsockname()
53 if __name__ == '__main__': main()