blob: 16d5d7b2d6c3d35e1b020ec5f63dd09cf65088b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#ifndef SWIFTEN_CONNECTION_H
#define SWIFTEN_CONNECTION_H
#include <boost/signals.hpp>
#include "Swiften/Base/ByteArray.h"
#include "Swiften/Base/String.h"
namespace Swift {
class Connection {
public:
enum Error {
DomainNameResolveError,
ConnectionError,
ReadError,
WriteError
};
Connection() {}
virtual ~Connection() {}
virtual void listen() = 0;
virtual void connect(const String& domain) = 0;
virtual void disconnect() = 0;
virtual void write(const ByteArray& data) = 0;
public:
boost::signal<void ()> onConnected;
boost::signal<void (Error)> onError;
boost::signal<void (const ByteArray&)> onDataRead;
};
}
#endif
|