1/*
2    This file is part of libmicrospdy
3    Copyright Copyright (C) 2012 Andrey Uzunov
4
5    This program is free software: you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation, either version 3 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program.  If not, see <http://www.gnu.org/licenses/>.
17*/
18
19/**
20 * @file daemon_start_stop.c
21 * @brief  starts and stops a SPDY daemon
22 * @author Andrey Uzunov
23 */
24
25#include "platform.h"
26#include "microspdy.h"
27#include "common.h"
28
29int
30main()
31{
32	SPDY_init();
33
34	struct SPDY_Daemon *daemon = SPDY_start_daemon(get_port(16123),
35	 DATA_DIR "cert-and-key.pem",
36	 DATA_DIR "cert-and-key.pem",
37	NULL,NULL,NULL,NULL,NULL,SPDY_DAEMON_OPTION_END);
38
39	if(NULL==daemon){
40		printf("no daemon\n");
41		return 1;
42	}
43
44	SPDY_stop_daemon(daemon);
45
46	SPDY_deinit();
47
48	return 0;
49}
50