fix conn.port AttributeError