def on_open_connection(self,conn): gen.listen(conn.on_open(),conn.exception_callback)
def on_close_connection(self,conn,code=None, reason=None): try: gen.listen(conn.on_close(code,reason),conn.exception_callback) except Exception, e: pass
def gen_listen(self,res): return gen.listen(res,self.exception_callback)