libt2n: (gerd) fixes & improvements
[libt2n] / src / socket_server.hxx
index ca2f03c..8f1b84c 100644 (file)
@@ -29,22 +29,25 @@ namespace libt2n
 class socket_server : public server
 {
     public:
-        enum socket_type { tcp, unix };
+        enum socket_type_value { tcp_s, unix_s };
 
     private:
-        int socket;
+        int sock;
         fd_set connection_set;
-        socket_type type;
-        string unix_path;
+        socket_type_value socket_type;
+        std::string unix_path;
+
+        void set_socket_options(int sock);
+        void new_connection();
 
     public:
         socket_server(int port, const char* ip="0.0.0.0");
-        socket_server(const char* path, mode_t chmod, const char* user="", const char* group="");
+        socket_server(const char* path, mode_t filemode, const char* user="", const char* group="");
 
         ~socket_server();
 
-        socket_type get_type()
-            { return type; }
+        socket_type_value get_type()
+            { return socket_type; }
 
         void fill_buffer(long long usec_timeout=-1);
 };