'Create a network connection.'

def AddListener(self, ip, port, family='INET', sock_type='SOCK_STREAM'):

    conn = rdf_client.NetworkConnection()
    conn.state = 'LISTEN'
    conn.family = family
    conn.type = sock_type
    conn.local_address = rdf_client.NetworkEndpoint(ip=ip, port=port)
    return conn
