X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=src%2Fsocket_client.hxx;h=1d8240005010700b4752a4f1a231a194edc80a54;hp=d680813b15cc04bdea2b393abeba6644e6cd2317;hb=b2ba092858a40fc42afba6b529d5b97bcba363e2;hpb=cc68aabb16ec32278df8b071c4c9efec7e9f0dce diff --git a/src/socket_client.hxx b/src/socket_client.hxx index d680813..1d82400 100644 --- a/src/socket_client.hxx +++ b/src/socket_client.hxx @@ -45,19 +45,24 @@ class socket_client_connection : public client_connection, public socket_handler std::string server; int port; + std::ostream* get_logstream(log_level_values level) + { return client_connection::get_logstream(level); } + public: socket_client_connection(const std::string& _server, int _port, int _max_retries=max_retries_default); socket_client_connection(const std::string& _path, int _max_retries=max_retries_default); /** @brief read data from the socket and copy it into buffer @param usec_timeout wait until new data is found, max timeout usecs. - -1: wait endless - NULL: no timeout + -1: wait endless + 0: return instantly + @param usec_timeout_remaining if non-NULL the function will write the + not used time to the given target @retval true if new data was found (does not mean that the received data is a complete packet though) */ - bool fill_buffer(long long usec_timeout=-1) - { return socket_handler::fill_buffer(buffer,usec_timeout); } + bool fill_buffer(long long usec_timeout=-1, long long *usec_timeout_remaining=NULL) + { return socket_handler::fill_buffer(buffer,usec_timeout,usec_timeout_remaining); } void close(); };