Revision c81c126e peerstreamer-ng.c

View differences:

peerstreamer-ng.c
123 123
	c->router = router_create(10);
124 124
	load_path_handlers(c->router);
125 125
	c->tm = task_manager_new();
126
	c->psm = pstreamer_manager_new(6001);
127 126

  
128 127
	c->mongoose_srv = (struct mg_mgr*) malloc(sizeof(struct mg_mgr));
129 128
	mg_mgr_init(c->mongoose_srv, c);
130 129

  
130
	c->janus = janus_instance_create(c->mongoose_srv, c->tm, NULL);
131
	janus_instance_launch(c->janus);
132
	c->psm = pstreamer_manager_new(6001, c->janus);
133

  
131 134
	parse_args(c, argc, argv);
132 135
	pstreamer_manager_set_streamer_options(c->psm, c->streamer_opts);
133 136
	c->pb = pschannel_bucket_new(c->csvfile);
......
158 161
		free(c->streamer_opts);
159 162
	router_destroy(&(c->router));
160 163
	pstreamer_manager_destroy(&(c->psm));  // this must be destroyed before task managers!
164
	sleep(1); //  let janus get the http notications for interrupting streaming sessions
165
	janus_instance_destroy(&(c->janus));  // this has to be destroyed after pstreamer_manager and before task_manager
161 166
	task_manager_destroy(&(c->tm));
162 167
	pschannel_bucket_destroy(&(c->pb));
163 168
	mg_mgr_free(c->mongoose_srv);

Also available in: Unified diff