p.serving = False
except httpd.ConnectionClosed:
- # whoops...
- raise httpd.ConnectionClosed
+ # whoops, remote end has died: remove client and
+ # remove proxy session, we cannot do anything else,
+ # there's nothing there to talk to.
+ self.client.removeConnection()
+ self.proxies.pop(session)
except:
print traceback.print_exc()
except ConnectionClosed:
#yield self.connectionClosed()
if _debug: print 'parse connection closed'
+ #yield self.server.queue.put((self, None)) # close connection
+ def removeConnection(self):
+ yield self.server.queue.put((self, None)) # close connection
+
def writeMessage(self, message):
try:
yield self.stream.write(message)
if not client: # if the server aborted abnormally,
break # hence close the listener.
if _debug: print 'client connection received', client, msg
+
+ if msg is None:
+ yield client.connectionClosed()
+ session = client.session
+ del self.clients[session]
+ continue
+
# if client.objectEncoding != 0 and client.objectEncoding != 3:
if client.objectEncoding != 0:
yield client.rejectConnection(reason='Unsupported encoding ' + str(client.objectEncoding) + '. Please use NetConnection.defaultObjectEncoding=ObjectEncoding.AMF0')