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