- g_io_channel_set_buffered(ctx->channels[0], FALSE);
- g_io_channel_set_buffered(ctx->channels[1], FALSE);
-
- sr_session_source_add_channel(ctx->channels[0], G_IO_IN | G_IO_ERR,
- 40, receive_data, ctx);
-
- /* Run the demo thread. */
- g_thread_init(NULL);
- /* This must to be done between g_thread_init() & g_thread_create(). */
- ctx->timer = g_timer_new();
- thread_running = 1;
- my_thread =
- g_thread_create((GThreadFunc)thread_func, ctx, TRUE, NULL);
- if (!my_thread) {
- sr_err("demo: %s: g_thread_create failed", __func__);
- return SR_ERR; /* TODO */
- }
-
- if (!(packet = g_try_malloc(sizeof(struct sr_datafeed_packet)))) {
- sr_err("demo: %s: packet malloc failed", __func__);
- return SR_ERR_MALLOC;
- }
-
- if (!(header = g_try_malloc(sizeof(struct sr_datafeed_header)))) {
- sr_err("demo: %s: header malloc failed", __func__);
- return SR_ERR_MALLOC;
- }