+#pragma once
+
+#include <cstring>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <string>
+#include <unistd.h>
+
+#define SERVERS_TO_CREATE 5
+
+struct server_st {
+private:
+ bool _used;
+ pid_t _pid;
+ in_port_t _port;
+ char pid_file[FILENAME_MAX]; // Did we start it, or was it just sitting there?
+public:
+
+ 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;
+ }