PJ_DEF(pj_status_t) pjsip_tls_transport_restart(pjsip_tpfactory *factory,
						const pj_sockaddr *local,
						const pjsip_host_port *a_name)
{
    pj_status_t status = PJ_SUCCESS;
    struct tls_listener *listener = (struct tls_listener *)factory;

    lis_close(listener);

    status = pjsip_tls_transport_lis_start(factory, local, a_name);
    if (status != PJ_SUCCESS) {	
	tls_perror(listener->factory.obj_name, 
		   "Unable to start listener after closing it", status, NULL);

	return status;
    }
    
    status = pjsip_tpmgr_register_tpfactory(listener->tpmgr,
					    &listener->factory);
    if (status != PJ_SUCCESS) {
	tls_perror(listener->factory.obj_name,
		    "Unable to register the transport listener", status, NULL);

	listener->is_registered = PJ_FALSE;	
    } else {
	listener->is_registered = PJ_TRUE;	
    }    

    return status;
}
PJ_DEF(pj_status_t) pjsip_tls_transport_restart(pjsip_tpfactory *factory,
						const pj_sockaddr *local,
						const pjsip_host_port *a_name)
{
    pj_status_t status = PJ_SUCCESS;
    struct tls_listener *listener = (struct tls_listener *)factory;

    lis_close(listener);

    status = pjsip_tls_transport_lis_start(factory, local, a_name);
    if (status != PJ_SUCCESS) {	
	tls_perror(listener->factory.obj_name, 
		   "Unable to start listener after closing it", status, NULL);

	return status;
    }
    
    status = pjsip_tpmgr_register_tpfactory(listener->tpmgr,
					    &listener->factory);
    if (status != PJ_SUCCESS) {
	tls_perror(listener->factory.obj_name,
		    "Unable to register the transport listener", status, NULL);

	listener->is_registered = PJ_FALSE;	
    } else {
	listener->is_registered = PJ_TRUE;	
    }    

    return status;
}