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