00001 /* 00002 Copyright (c) 2004-2008 by Jakob Schroeter <js@camaya.net> 00003 This file is part of the gloox library. http://camaya.net/gloox 00004 00005 This software is distributed under a license. The full license 00006 agreement can be found in the file LICENSE in this distribution. 00007 This software may not be copied, modified, sold or distributed 00008 other than expressed in the named license agreement. 00009 00010 This software is distributed without any warranty. 00011 */ 00012 00013 00014 #ifndef CONNECTIONTCPCLIENT_H__ 00015 #define CONNECTIONTCPCLIENT_H__ 00016 00017 #include "gloox.h" 00018 #include "connectiontcpbase.h" 00019 #include "logsink.h" 00020 00021 #include <string> 00022 00023 namespace gloox 00024 { 00025 00036 class GLOOX_API ConnectionTCPClient : public ConnectionTCPBase 00037 { 00038 public: 00049 ConnectionTCPClient( const LogSink& logInstance, const std::string& server, int port = -1 ); 00050 00059 ConnectionTCPClient( ConnectionDataHandler *cdh, const LogSink& logInstance, 00060 const std::string& server, int port = -1 ); 00061 00065 virtual ~ConnectionTCPClient(); 00066 00067 // reimplemented from ConnectionBase 00068 virtual ConnectionError recv( int timeout = -1 ); 00069 00070 // reimplemented from ConnectionBase 00071 virtual ConnectionError connect(); 00072 00073 // reimplemented from ConnectionBase 00074 virtual ConnectionBase* newInstance() const; 00075 00076 private: 00077 ConnectionTCPClient &operator=( const ConnectionTCPClient & ); 00078 00079 }; 00080 00081 } 00082 00083 #endif // CONNECTIONTCPCLIENT_H__