# HG changeset patch # User morphbr # Date 1175701530 -3600 # Node ID 970cbd5f0ba625856a5b6ac9ad1b0cf2f4fb7b32 # Parent f1411bd6f17e60c71cd5f618d72df8ba6cffcb54 [svn r500] - Solving client problems diff -r f1411bd6f17e -r 970cbd5f0ba6 gmyth-stream/server/tests/client_ffmpeg.py --- a/gmyth-stream/server/tests/client_ffmpeg.py Wed Apr 04 16:33:09 2007 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -import os -import sys -import time -import socket - - -if len(sys.argv) < 2: - HOST = 'localhost' - PORT = 5000 -elif len(sys.argv) == 2: - HOST = sys.argv[1] - PORT = 5000 -else: - HOST = sys.argv[1] - PORT = int(sys.argv[2]) - -socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM) -socket.settimeout(10) - -try: - socket.connect( (HOST,PORT) ) -except: - print "\n--> Could not connect to ('%s':'%d')\n" % (HOST,PORT) - sys.exit(-1) - - -mplayer = os.popen("which mplayer").read().strip() -mplayer += " - 1> /dev/null" -pin, pout = os.popen2(mplayer) - -#teste = open("/tmp/teste2", "w") - -data = socket.recv(1024) -i = 0 - -while (data != ""): - pin.write(data) - #teste.write(data) - data = socket.recv(1024) - if (i == 500): - socket.send("OK") - i += 1 - -pin.close() -socket.close() - - -# from select import select -# r, w, x = select([pout], []. [], 0) -# if pout in r: -# pout.read(32)