gloox  1.0.28
connectiontcpclient.h
1 /*
2  Copyright (c) 2004-2023 by Jakob Schröter <js@camaya.net>
3  This file is part of the gloox library. http://camaya.net/gloox
4 
5  This software is distributed under a license. The full license
6  agreement can be found in the file LICENSE in this distribution.
7  This software may not be copied, modified, sold or distributed
8  other than expressed in the named license agreement.
9 
10  This software is distributed without any warranty.
11 */
12 
13 
14 #ifndef CONNECTIONTCPCLIENT_H__
15 #define CONNECTIONTCPCLIENT_H__
16 
17 #include "gloox.h"
18 #include "connectiontcpbase.h"
19 #include "logsink.h"
20 
21 #include <string>
22 
23 namespace gloox
24 {
25 
36  class GLOOX_API ConnectionTCPClient : public ConnectionTCPBase
37  {
38  public:
49  ConnectionTCPClient( const LogSink& logInstance, const std::string& server, int port = -1 );
50 
59  ConnectionTCPClient( ConnectionDataHandler* cdh, const LogSink& logInstance,
60  const std::string& server, int port = -1 );
61 
65  virtual ~ConnectionTCPClient();
66 
67  // reimplemented from ConnectionBase
68  virtual ConnectionError recv( int timeout = -1 );
69 
70  // reimplemented from ConnectionBase
71  virtual ConnectionError connect();
72 
73  // reimplemented from ConnectionBase
74  virtual ConnectionBase* newInstance() const;
75 
76  private:
77  ConnectionTCPClient &operator=( const ConnectionTCPClient & );
78 
79  };
80 
81 }
82 
83 #endif // CONNECTIONTCPCLIENT_H__
An abstract base class for a connection.
This is an abstract base class to receive events from a ConnectionBase-derived object.
This is a base class for a simple TCP connection.
This is an implementation of a simple TCP connection.
An implementation of log sink and source.
Definition: logsink.h:39
The namespace for the gloox library.
Definition: adhoc.cpp:28
ConnectionError
Definition: gloox.h:684