X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=src%2Fsocket_server.hxx;h=5dcf4f33227f1c52cec54c481d51a951d48b2ada;hp=558b058af3bb059b0f198a8010b49a92f67c352b;hb=07e98688a1a8c3e915ce923f79261a88251a9edd;hpb=a11e19b7adab2d5b937573701959562f06087ac5 diff --git a/src/socket_server.hxx b/src/socket_server.hxx index 558b058..5dcf4f3 100644 --- a/src/socket_server.hxx +++ b/src/socket_server.hxx @@ -20,6 +20,7 @@ #define __LIBT2N_SOCKET_SERVER #include +#include #include "server.hxx" #include "socket_handler.hxx" @@ -31,7 +32,7 @@ namespace libt2n /** Socket based server class */ -class socket_server : public socket_handler, server +class socket_server : public socket_handler, public server { private: fd_set connection_set; @@ -46,8 +47,8 @@ class socket_server : public socket_handler, server { server::log(level,message); } public: - socket_server(int port, const char* ip="0.0.0.0"); - socket_server(const char* path, mode_t filemode, const char* user="", const char* group=""); + socket_server(int port, const std::string& ip="0.0.0.0"); + socket_server(const std::string& path, mode_t filemode=00770, const std::string& user="", const std::string& group=""); ~socket_server(); @@ -60,7 +61,7 @@ class socket_server : public socket_handler, server /** Socket based connection class */ -class socket_server_connection : public socket_handler, server_connection +class socket_server_connection : public socket_handler, public server_connection { friend class socket_server; @@ -69,15 +70,14 @@ class socket_server_connection : public socket_handler, server_connection : server_connection(_timeout), socket_handler(_sock,_stype) { } - void log(log_level_values level, const char* message) - { if(my_server) my_server->log(level,message); } + void log(log_level_values level, const char* message); void real_write(const std::string& data) - { socket_handler::write(data); } + { socket_write(data); } public: - void fill_buffer(long long usec_timeout=-1) - { socket_handler::fill_buffer(buffer,usec_timeout); } + bool fill_buffer(long long usec_timeout=-1) + { return socket_handler::fill_buffer(buffer,usec_timeout); } void close(); };