equal
deleted
inserted
replaced
|
1 /* |
|
2 * $Id: PacketReader.h 2 2007-12-22 14:15:30Z mbroeker $ |
|
3 * $URL: http://localhost/svn/cpp/qMonitor/trunk/include/PacketReader.h $ |
|
4 */ |
|
5 |
|
6 #ifndef PacketReader_H |
|
7 #define PacketReader_H |
|
8 |
|
9 #include <string> |
|
10 #include <stdexcept> |
|
11 #include <iostream> |
|
12 |
|
13 extern "C" { |
|
14 #include <sys/socket.h> |
|
15 #include <netinet/if_ether.h> |
|
16 #include <netinet/ip.h> |
|
17 #include <sys/poll.h> |
|
18 #include <fcntl.h> |
|
19 #include <sys/types.h> |
|
20 #include <unistd.h> |
|
21 }; |
|
22 |
|
23 class PacketReader { |
|
24 protected: |
|
25 int p_socket; |
|
26 private: |
|
27 int timeout; |
|
28 public: |
|
29 PacketReader ( int tm = 500 ); |
|
30 PacketReader ( std::string ); |
|
31 ~PacketReader(); |
|
32 std::string read(); |
|
33 bool ready(); |
|
34 bool dataAvailable(); |
|
35 }; |
|
36 |
|
37 #endif |