Beispiel #1
0
	static int APP_CC
setup_listen(void)
{
	char port[256];
	int error;

	if (g_lis_trans != 0)
	{
		trans_delete(g_lis_trans);
	}
	if (g_use_unix_socket)
	{
		g_lis_trans = trans_create(2, 8192, 8192);
		g_snprintf(port, 255, "/var/spool/xrdp/xrdp_chansrv_socket_%d", 7200 + g_display_num);
	}
	else
	{
		g_lis_trans = trans_create(1, 8192, 8192);
		g_snprintf(port, 255, "%d", 7200 + g_display_num);
	}
	g_lis_trans->trans_conn_in = my_trans_conn_in;
	error = trans_listen(g_lis_trans, port);
	if (error != 0)
	{
		log_message(&log_conf, LOG_LEVEL_DEBUG, "chansrv[setup_listen]: "
				"setup_listen: trans_listen failed for port %s", port);
		return 1;
	}
	return 0;
}
Beispiel #2
0
int APP_CC
sound_init(void)
{
    char port[256];
    int error;

    print_got_here();
    LOG(0, ("sound_init:"));

    sound_send_server_formats();
    g_audio_l_trans = trans_create(2, 128 * 1024, 8192);
    g_snprintf(port, 255, CHANSRV_PORT_STR, g_display_num);
    g_audio_l_trans->trans_conn_in = sound_trans_audio_conn_in;
    error = trans_listen(g_audio_l_trans, port);

    if (error != 0)
    {
        LOG(0, ("sound_init: trans_listen failed"));
    }

#if defined(XRDP_SIMPLESOUND)

    /* start thread to read raw audio data from pulseaudio device */
    tc_thread_create(read_raw_audio_data, 0);

#endif

    return 0;
}
Beispiel #3
0
static int APP_CC
setup_listen(void)
{
    char port[256];
    int error = 0;

    if (g_lis_trans != 0)
    {
        trans_delete(g_lis_trans);
    }

    if (g_use_unix_socket)
    {
        g_lis_trans = trans_create(2, 8192, 8192);
        g_snprintf(port, 255, "/tmp/.xrdp/xrdp_chansrv_socket_%d",
                   7200 + g_display_num);
    }
    else
    {
        g_lis_trans = trans_create(1, 8192, 8192);
        g_snprintf(port, 255, "%d", 7200 + g_display_num);
    }

    g_lis_trans->trans_conn_in = my_trans_conn_in;
    error = trans_listen(g_lis_trans, port);

    if (error != 0)
    {
        LOGM((LOG_LEVEL_ERROR, "setup_listen: trans_listen failed for port %s",
              port));
        return 1;
    }

    return 0;
}
Beispiel #4
0
static int APP_CC
setup_api_listen(void)
{
    char port[256];
    int error = 0;

    g_api_lis_trans = trans_create(TRANS_MODE_UNIX, 8192 * 4, 8192 * 4);
    g_snprintf(port, 255, "/tmp/.xrdp/xrdpapi_%d", g_display_num);
    g_api_lis_trans->trans_conn_in = my_api_trans_conn_in;
    error = trans_listen(g_api_lis_trans, port);

    if (error != 0)
    {
        LOGM((LOG_LEVEL_ERROR, "setup_api_listen: trans_listen failed for port %s",
              port));
        return 1;
    }

    return 0;
}