include/PacketReader.h
changeset 3 724e07a9f155
parent 0 826dd5531eb0
child 4 fdf04a93faeb
equal deleted inserted replaced
2:62ddf5dd4db0 3:724e07a9f155
     9 #include <string>
     9 #include <string>
    10 #include <stdexcept>
    10 #include <stdexcept>
    11 #include <iostream>
    11 #include <iostream>
    12 
    12 
    13 extern "C" {
    13 extern "C" {
    14 	#include <sys/socket.h>
    14 #include <sys/socket.h>
    15 	#include <netinet/if_ether.h>
    15 #include <netinet/if_ether.h>
    16 	#include <netinet/ip.h>
    16 #include <netinet/ip.h>
    17 	#include <sys/poll.h>
    17 #include <sys/poll.h>
    18 	#include <fcntl.h>
    18 #include <fcntl.h>
    19 	#include <sys/types.h>
    19 #include <sys/types.h>
    20 	#include <unistd.h>
    20 #include <unistd.h>
    21 };
    21 };
    22 
    22 
    23 class PacketReader {
    23 class PacketReader {
    24 protected:
    24   protected:
    25 	int p_socket;
    25     int p_socket;
    26  private:
    26   private:
    27 	int timeout;
    27     int timeout;
    28 public:
    28   public:
    29 	PacketReader ( int tm = 500 );
    29       PacketReader (int tm = 500);
    30 	PacketReader ( std::string );
    30       PacketReader (std::string);
    31 	~PacketReader();
    31      ~PacketReader ();
    32 	std::string read();
    32       std::string read ();
    33 	bool ready();
    33     bool ready ();
    34 	bool dataAvailable();
    34     bool dataAvailable ();
    35 };
    35 };
    36 
    36 
    37 #endif
    37 #endif