Revision 75f059a3

View differences:

chunker_player/chunker_player.c
107 107
    );
108 108
}
109 109

  
110
// initialize a receiver instance for receiving chunks from a Streamer process
111
// returns: <0 on error
112
int initIPCReceiver(Port)
113
{
114
#ifdef HTTPIO
115
	struct MHD_Daemon *daemon = NULL;
116
	//this thread fetches chunks from the network by listening to the following path, port
117
	daemon = (struct MHD_Daemon*)initChunkPuller(UL_DEFAULT_EXTERNALPLAYER_PATH, Port);
118
	if(daemon == NULL)
119
	{
120
		printf("CANNOT START MICROHTTPD SERVICE, EXITING...\n");
121
		return -1;
122
	}
123
#endif
124
#ifdef TCPIO
125
	int fd = initChunkPuller(Port);
126
	if(! (fd > 0))
127
	{
128
		printf("CANNOT START TCP PULLER...\n");
129
		return -1;
130
	}
131
#endif
132

  
133
	return 1;
134
}
135

  
110 136
int main(int argc, char *argv[])
111 137
{
112 138
	srand ( time(NULL) );
......
210 236
	}
211 237
#endif
212 238

  
213
#ifdef HTTPIO
214
	struct MHD_Daemon *daemon = NULL;
215
	//this thread fetches chunks from the network by listening to the following path, port
216
	daemon = (struct MHD_Daemon*)initChunkPuller(UL_DEFAULT_EXTERNALPLAYER_PATH, Port);
217
	if(daemon == NULL)
218
	{
219
		printf("CANNOT START MICROHTTPD SERVICE, EXITING...\n");
239
	if (initIPCReceiver(Port) < 0) {
220 240
		exit(2);
221 241
	}
222
#endif
223
#ifdef TCPIO
224
	int fd = initChunkPuller(Port);
225
	if(! (fd > 0))
226
	{
227
		printf("CANNOT START TCP PULLER...\n");
228
		exit(2);
229
	}
230
#endif
242

  
231 243
#ifdef PSNR_PUBLICATION
232 244
	repoclient=NULL;
233 245
	LastTimeRepoPublish.tv_sec=0;

Also available in: Unified diff