|
@@ -1,9 +1,10 @@
|
1
|
1
|
#!/usr/bin/python
|
2
|
2
|
# -*- coding: utf-8 -*-
|
3
|
3
|
"""
|
4
|
|
-StreamProxy daemon (based on Livestream daemon)
|
|
4
|
+Playstreamproxy daemon (based on Livestream daemon)
|
5
|
5
|
Provides API to ContetSources + stream serving to play via m3u8 playlists
|
6
|
6
|
"""
|
|
7
|
+
|
7
|
8
|
import os, sys, time, re, json
|
8
|
9
|
import ConfigParser
|
9
|
10
|
import atexit
|
|
@@ -309,7 +310,7 @@ def start(host = HOST_NAME, port = PORT_NUMBER, redirect=REDIRECT):
|
309
|
310
|
httpd.server_close()
|
310
|
311
|
print time.asctime(), "Server Stops - %s:%s" % (HOST_NAME, PORT_NUMBER)
|
311
|
312
|
|
312
|
|
-def start2(host = HOST_NAME, port = PORT_NUMBER, redirect=REDIRECT):
|
|
313
|
+def start2(host = HOST_NAME, port = PORT_NUMBER, redirect=REDIRECT,workers=WORKERS):
|
313
|
314
|
global REDIRECT
|
314
|
315
|
if redirect:
|
315
|
316
|
REDIRECT = redirect
|
|
@@ -337,7 +338,7 @@ def start2(host = HOST_NAME, port = PORT_NUMBER, redirect=REDIRECT):
|
337
|
338
|
httpd.server_bind = self.server_close = lambda self: None
|
338
|
339
|
|
339
|
340
|
httpd.serve_forever()
|
340
|
|
- [Thread(i) for i in range(10)]
|
|
341
|
+ [Thread(i) for i in range(workers)]
|
341
|
342
|
time.sleep(9e5)
|
342
|
343
|
print time.asctime(), "Server Stops - %s:%s" % (HOST_NAME, PORT_NUMBER)
|
343
|
344
|
|