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

svcdesocketbruto.hpp

Go to the documentation of this file.
00001 
00002 //
00003 // Fichero            : SvcDeSocketBruto.h
00004 // Autor              : Javier Gomez Sanchez
00005 // Fecha creacion     : 
00006 // 
00007 // Descripcion        : 
00008 // 
00009 // Notas
00010 //   -  
00012 
00013 #ifndef __SvcDeSocketBruto_H__
00014 #define __SvcDeSocketBruto_H__
00015 
00016 
00017 
00018 #include "jic/socket/acceptor.hpp"
00019 #include "jic/task/producers/fndesocketbruto.hpp"
00020 #include "jic/socket/capturatrafico.hpp"
00021 #include "jic/task/CMessageBlock.hpp"
00022 #include "jic/task/CChainTask.hpp"
00023 #include "jic/socket/sockets.hpp"
00024 
00025 
00026 namespace SOCKETS
00027 {
00028 
00029   EXCEPCION(ExcSalidaNoConectada);
00030 
00031   //------------------------------------------------------------------------------
00032   //------------------------------------------------------------------------------
00033   class SvcDeSocketBruto : public SOCKETS::Servicio
00034   {
00035   public:
00036     SvcDeSocketBruto();
00037 
00038     // Es llamado por cada Msg recibido
00039     int open(void *);
00040 
00041     // Es llamado por cada Msg recibido
00042     virtual int handle_input(ACE_HANDLE idConexion);
00043     
00044     void set_pNext(TASK::CChainTask<SOCKETS::CapturaTrafico> * next);
00045 
00046   private:
00047     TASK::CChainTask<SOCKETS::CapturaTrafico> * _objAct;
00048 
00049     // Conexiones activas
00050     TASK::PRODUCERS::FnDeSocketBruto _fnDeSocketB;
00051     typedef std::map<ACE_HANDLE, SOCKETS::Socket > MapaConexiones;
00052     MapaConexiones _mapaConexiones;
00053   };
00054 
00055   //------------------------------------------------------------------------------
00056   //------------------------------------------------------------------------------
00057   class LectorDeSocketBruto 
00058     : public SOCKETS::Acceptor<SvcDeSocketBruto>
00059   {
00060   public:
00061     LectorDeSocketBruto(int puertoEscucha) 
00062       : SOCKETS::Acceptor<SvcDeSocketBruto> (puertoEscucha, 
00063         (_svc = new SvcDeSocketBruto))
00064     {
00065       O_TRAZA("SERVICIOS::LectorDeSocket::LectorDeSocket(puertoEscucha=" << puertoEscucha << ")");
00066     }
00067     
00068     virtual ~LectorDeSocketBruto() {
00069       O_TRAZA("SERVICIOS::LectorDeSocket::~LectorSondaInelcom()");
00070       delete _svc;
00071     }
00072 
00073     void set_pNext(TASK::CChainTask<SOCKETS::CapturaTrafico> * next)
00074     {
00075       _svc->set_pNext(next);
00076     };
00077 
00078   private:
00079     SvcDeSocketBruto * _svc;
00080   };
00081 
00082 
00083 } // namespace SOCKETS
00084 
00085 #endif
00086 
00087 
00088 
00089 

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