gloox  1.0.20
connectiontcpserver.h
1 /*
2  Copyright (c) 2007-2017 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 CONNECTIONTCPSERVER_H__
15 #define CONNECTIONTCPSERVER_H__
16 
17 #include "gloox.h"
18 #include "connectiontcpbase.h"
19 #include "logsink.h"
20 
21 #include <string>
22 
23 namespace gloox
24 {
25 
26  class ConnectionHandler;
27 
36  class GLOOX_API ConnectionTCPServer : public ConnectionTCPBase
37  {
38  public:
47  ConnectionTCPServer( ConnectionHandler* ch, const LogSink& logInstance,
48  const std::string& ip, int port );
49 
53  virtual ~ConnectionTCPServer();
54 
55  // reimplemented from ConnectionBase
56  virtual ConnectionError recv( int timeout = -1 );
57 
62  // reimplemented from ConnectionBase
63  virtual ConnectionError connect();
64 
65  // reimplemented from ConnectionBase
66  virtual ConnectionBase* newInstance() const;
67 
68  private:
69  ConnectionTCPServer &operator=( const ConnectionTCPServer & );
70 
71  ConnectionHandler* m_connectionHandler;
72 
73  };
74 
75 }
76 
77 #endif // CONNECTIONTCPSERVER_H__
An abstract base class for a connection.
This is an implementation of a simple listening TCP connection.
ConnectionError
Definition: gloox.h:683
This is a base class for a simple TCP connection.
This is an abstract base class to receive incoming connection attempts. Do not confuse this with Conn...
The namespace for the gloox library.
Definition: adhoc.cpp:27
An implementation of log sink and source.
Definition: logsink.h:38