diff -r 1b897f699097 -r ed34b1dab103 gmyth-stream/server/tests/client.py --- a/gmyth-stream/server/tests/client.py Wed Apr 18 15:47:40 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 = 50000 -elif len(sys.argv) == 2: - HOST = sys.argv[1] - PORT = 50000 -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 += " -idx - -vo x11 1> /dev/null" -pin, pout = os.popen2(mplayer) - -#teste = open("teste.avi", "w") - -data = socket.recv(4096) -i = 0 - -while (data != ""): - pin.write(data) - #teste.write(data) - data = socket.recv(4096) - #if (i == 500): - # socket.send("OK") - i += 1 - -pin.close() -socket.close() -#teste.close() - -# from select import select -# r, w, x = select([pout], []. [], 0) -# if pout in r: -# pout.read(32)