Commit | Line | Data |
---|---|---|
6650af14 BS |
1 | /** @file |
2 | * @brief NetHelper class header. This class represents a Helper to easily perform tcp/ip operations. | |
3 | * | |
4 | * | |
5 | * | |
6 | * @copyright Intra2net AG | |
7 | * @license GPLv2 | |
8 | */ | |
9 | ||
10 | #ifndef NETHELPER_H | |
11 | #define NETHELPER_H | |
12 | ||
4de6a9b8 BS |
13 | #include "logger.hpp" |
14 | #include "ip_service.hpp" | |
6650af14 BS |
15 | |
16 | #include <boost/shared_ptr.hpp> | |
17 | ||
18 | ||
19 | class NetHelper | |
20 | { | |
92beaba3 | 21 | |
6650af14 BS |
22 | private: |
23 | ||
24 | Logger::Ptr Log; | |
25 | IPService::Ptr IPServicePtr; | |
26 | ||
27 | public: | |
28 | ||
29 | typedef boost::shared_ptr<NetHelper> Ptr; | |
30 | ||
c9d27cb6 BS |
31 | NetHelper(); |
32 | ||
6650af14 BS |
33 | NetHelper(const Logger::Ptr _log); |
34 | ||
35 | ~NetHelper(); | |
36 | ||
83ae2edf | 37 | int open_connection(const std::string& _host, const std::string& _port) const; |
6650af14 | 38 | |
31beb90a | 39 | int send_data(const std::string& data) const; |
6650af14 | 40 | |
31beb90a | 41 | std::string receive_data() const; |
6650af14 | 42 | |
31beb90a | 43 | int close_connection() const; |
6650af14 BS |
44 | |
45 | }; | |
46 | ||
47 | #endif |