Ignore:
Timestamp:
02/07/15 19:18:51 (9 years ago)
Author:
atzm
Message:

fix a listport bug on tornado 4.0.x

File:
1 edited

Legend:

Unmodified
Added
Removed
  • etherws/trunk/etherws.py

    r274 r276  
    1111# 
    1212# =========================================================================== 
    13 # Copyright (c) 2012-2014, Atzm WATANABE <atzm@atzm.org> 
     13# Copyright (c) 2012-2015, Atzm WATANABE <atzm@atzm.org> 
    1414# All rights reserved. 
    1515# 
     
    419419    @property 
    420420    def target(self): 
    421         return ':'.join(str(e) for e in self.request.connection.address) 
     421        conn = self.request.connection 
     422        if hasattr(conn, 'address'): 
     423            return ':'.join(str(e) for e in conn.address) 
     424        if hasattr(conn, 'context'): 
     425            return ':'.join(str(e) for e in conn.context.address) 
     426        return str(conn) 
    422427 
    423428    def open(self): 
Note: See TracChangeset for help on using the changeset viewer.