2 * Copyright (C) 2011 Data Differential, http://datadifferential.com/
3 * Copyright (C) 2006-2009 Brian Aker
6 * Use and distribution licensed under the BSD license. See
7 * the COPYING file in the parent directory for full text.
14 #include <netinet/in.h>
18 #define SERVERS_TO_CREATE 5
25 char pid_file
[FILENAME_MAX
]; // Did we start it, or was it just sitting there?
28 char hostname
[NI_MAXHOST
];
36 strncpy(hostname
, "localhost", sizeof(hostname
));
39 void set_port(in_port_t arg
)
44 in_port_t
port() const
51 return not _port
== 0;
59 void set_pid(pid_t arg
)
81 bool is_socket() const
83 return hostname
[0] == '/';
86 void set_hostname(const char *arg
)
88 strncpy(hostname
, arg
, sizeof(hostname
));
97 std::ostream
& operator<<(std::ostream
& output
, const server_st
&arg
);
99 struct server_startup_st
103 std::string server_list
;
104 server_st server
[SERVERS_TO_CREATE
];
106 server_startup_st() :
107 count(SERVERS_TO_CREATE
),
120 bool server_startup(server_startup_st
*construct
);
121 void server_shutdown(server_startup_st
*construct
);