X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=src%2Fsocket_client.hxx;h=037c6ca3bcd24b7115b389c26a106827b6325b05;hp=c103cbb1c293cb4e259ed2540754981a07e3aa57;hb=19facd8558fe2e32ce843860b40631ebe03ff3cf;hpb=e1614a6d1d9c022b83c0aa8cdb948bd7dc98ff23 diff --git a/src/socket_client.hxx b/src/socket_client.hxx index c103cbb..037c6ca 100644 --- a/src/socket_client.hxx +++ b/src/socket_client.hxx @@ -1,21 +1,24 @@ -/*************************************************************************** - * Copyright (C) 2006 by Gerd v. Egidy * - * gve@intra2net.com * - * * - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ +/* +Copyright (C) 2006 by Intra2net AG - Gerd v. Egidy + +The software in this package is distributed under the GNU General +Public License version 2 (with a special exception described below). + +A copy of GNU General Public License (GPL) is included in this distribution, +in the file COPYING.GPL. + +As a special exception, if other files instantiate templates or use macros +or inline functions from this file, or you compile this file and link it +with other works to produce a work based on this file, this file +does not by itself cause the resulting work to be covered +by the GNU General Public License. + +However the source code for this file must still be made available +in accordance with section (3) of the GNU General Public License. + +This exception does not invalidate any other reasons why a work based +on this file might be covered by the GNU General Public License. +*/ #ifndef __LIBT2N_SOCKET_CLIENT #define __LIBT2N_SOCKET_CLIENT @@ -51,6 +54,8 @@ class socket_client_connection : public client_connection, public socket_handler std::string server; int port; + std::string lastErrorMsg; + protected: std::ostream* get_logstream(log_level_values level) @@ -66,6 +71,8 @@ class socket_client_connection : public client_connection, public socket_handler int _max_retries=max_retries_default, std::ostream *_logstream=NULL, log_level_values _log_level=none); + ~socket_client_connection(); + /** @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 @@ -78,9 +85,12 @@ class socket_client_connection : public client_connection, public socket_handler 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(); + virtual void close(); void reconnect(); + + std::string get_last_error_msg(void) + { return lastErrorMsg; } }; }