# HG changeset patch # User renatofilho # Date 1187275737 -3600 # Node ID ec0a31edf362675f2c06a8562ecb41e1aa3d8375 # Parent 215c45290ce3bb45040768e57857f0761b7c725f [svn r815] added sockmonitor on gmencoder plugin diff -r 215c45290ce3 -r ec0a31edf362 gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py --- a/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py Thu Aug 16 15:24:01 2007 +0100 +++ b/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py Thu Aug 16 15:48:57 2007 +0100 @@ -77,9 +77,9 @@ return False try: - #p = select.poll() + p = select.poll() #print outfd.fileno() - #p.register (connection, select.POLLNVAL | select.POLLERR | select.POLLHUP) + p.register (outfd, select.POLLNVAL | select.POLLERR | select.POLLHUP | select.POLLIN ) while (self.proc and self.proc.poll() == None): r, w, x = select.select([self.proc.stdout], [], [], 1) if self.proc.stdout in r: @@ -88,15 +88,12 @@ self.status = progress.split (":")[1] elif (progress.find ("Erro") >= 0): return False - """ - try: - print connection.getpeername() - print connection.getsockname() - except Esception, e: - print "Lost Connection" - self.stop () - return False - """ + + ret = p.poll(0) + if ret: + print "Lost Connection" + self.stop () + return False except Exception, e: self.log.error(self.tid, "Problems handling data: %s" % e)