X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=src%2Fsocket_handler.hxx;h=82ccdad368a6e13edd53c606ea6c2955688f5301;hp=8ea65a1199751a8bde6a634b0401fc0eac4ea9f6;hb=fc922d87a02a9c171b9d95c4b40b8ae85f0fadc0;hpb=9424729586fdb0aabb671d2f1266bdb07e0bed38 diff --git a/src/socket_handler.hxx b/src/socket_handler.hxx index 8ea65a1..82ccdad 100644 --- a/src/socket_handler.hxx +++ b/src/socket_handler.hxx @@ -19,6 +19,8 @@ #ifndef __LIBT2N_SOCKET_HANDLER #define __LIBT2N_SOCKET_HANDLER +#include + #include "types.hxx" namespace libt2n @@ -35,7 +37,7 @@ class socket_handler socket_type_value socket_type; - bool data_waiting(long long usec_timeout=-1); + bool data_waiting(long long usec_timeout,long long *timeout_remaining=NULL); protected: int sock; @@ -45,16 +47,14 @@ class socket_handler void set_socket_options(int sock); - void log(log_level_values level, const std::string& message) - { log(level,message.c_str()); } - virtual void log(log_level_values level, const char* message) - { return; } + virtual std::ostream* get_logstream(log_level_values level) + { return NULL; } void socket_write(const std::string& data); virtual void close(); - bool fill_buffer(std::string& buffer, long long usec_timeout); + bool fill_buffer(std::string& buffer, long long usec_timeout, long long*timeout_remaining=NULL); bool fill_buffer(std::string& buffer); public: