+ char hostname[NI_MAXHOST];
+
+ server_st() :
+ _used(false),
+ _pid(-1),
+ _port(0)
+ {
+ pid_file[0]= 0;
+ strncpy(hostname, "localhost", sizeof(hostname));
+ }
+
+ void set_port(in_port_t arg)
+ {
+ _port= arg;
+ }
+
+ in_port_t port() const
+ {
+ return _port;
+ }
+
+ bool has_port() const
+ {
+ return not _port == 0;
+ }
+
+ void set_used()
+ {
+ _used= true;
+ }
+
+ void set_pid(pid_t arg)
+ {
+ _pid= arg;
+ }
+
+ pid_t pid() const
+ {
+ return _pid;
+ }
+
+ bool is_used() const
+ {
+ return _used;
+ }
+
+ ~server_st();
+
+ bool has_pid()
+ {
+ return _pid > 0;
+ }
+
+ bool is_socket() const
+ {
+ return hostname[0] == '/';
+ }
+
+ void set_hostname(const char *arg)
+ {
+ strncpy(hostname, arg, sizeof(hostname));
+ }
+
+ bool kill();
+
+private:
+ void reset_pid();
+};
+
+std::ostream& operator<<(std::ostream& output, const server_st &arg);