X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=src%2Fsocket_client.hxx;fp=src%2Fsocket_client.hxx;h=117aa6d64aaa22227b2d73116d5a49d1257b396c;hp=0000000000000000000000000000000000000000;hb=a11e19b7adab2d5b937573701959562f06087ac5;hpb=5816531135da09aceb7a026eeade735cbd20ef03 diff --git a/src/socket_client.hxx b/src/socket_client.hxx new file mode 100644 index 0000000..117aa6d --- /dev/null +++ b/src/socket_client.hxx @@ -0,0 +1,46 @@ +/*************************************************************************** + * 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. * + ***************************************************************************/ +#ifndef __LIBT2N_SOCKET_CLIENT +#define __LIBT2N_SOCKET_CLIENT + +#include "client.hxx" +#include "socket_handler.hxx" + +namespace libt2n +{ + +class socket_client_connection : public client_connection, socket_handler +{ + private: + void real_write(const std::string& data) + { socket_handler::write(data); } + + public: + socket_client_connection(int port, const char* ip="0.0.0.0"); + socket_client_connection(const char* path, mode_t filemode, const char* user="", const char* group=""); + + void fill_buffer(long long usec_timeout=-1) + { socket_handler::fill_buffer(buffer,usec_timeout); } + + void close(); +}; + +} + +#endif