Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

capturatrafico.hpp

Go to the documentation of this file.
00001 #ifndef CAPTURA_TRAFICO_H
00002 #define CAPTURA_TRAFICO_H
00003 
00004 
00005 #include "jic/socket/sockets.hpp"
00006 #include <strings.h>
00007 
00008 namespace SOCKETS
00009 {
00010 
00011 // @ This should be system dependant
00012 #define TAM_BUFFER_CAPTURA 1024 * 4
00013 
00014 class CapturaTrafico
00015 {
00016 public:
00017 
00018    CapturaTrafico(SOCKETS::Socket & socket);
00019    
00020    // Indica si quedan datos
00021    bool quedanDatos() const { return _datosDados < _tamanio; }
00022    unsigned int tamanio() const { return _tamanio; }
00023    unsigned int datosDados() const { return _datosDados; }
00024    
00025    // Escribe en 'buffer', 'tamanio' bytes
00026    // Devuelve el numero de bytes que se devuelven
00027    unsigned int dameNBytes(unsigned char buffer[],unsigned int tamanio);           // Para retirar datos del buffer
00028    
00029 private:
00030    unsigned char _datos[TAM_BUFFER_CAPTURA];  
00031    unsigned int _tamanio;                  // Datos que hay en el buffer
00032    unsigned int _datosDados;              // Datos que se han retirado ya del buffer
00033 };
00034 
00035 } // namespace SOCKETS 
00036 
00037 #endif /* CAPTURA_TRAFICO_H */

Generated on Wed Mar 5 21:31:47 2003 for JIC by doxygen1.3-rc3