00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00027
00028 #ifndef __ACEPTOR_H__
00029 #define __ACEPTOR_H__
00030
00031 #include "jic/socket/sockets.hpp"
00032 #include "jic/log/trazas.hpp"
00033
00034 #include "ace/Acceptor.h"
00035 #include "ace/SOCK_Acceptor.h"
00036
00037 #include <string>
00038
00039
00040
00041 namespace SOCKETS
00042 {
00043
00044 enum PoliticaCreacionSvcHnd
00045 {
00046 SINGLETON,
00047 NO_SINGLETON
00048 };
00049
00050
00051
00052
00053 template<class ServiceHandler>
00054 class Acceptor : public ACE_Acceptor<ServiceHandler, ACE_SOCK_ACCEPTOR>
00055 {
00056 public:
00057
00058 Acceptor(int puerto, ServiceHandler *svcHnd);
00059 Acceptor(int puerto, PoliticaCreacionSvcHnd politica = SINGLETON);
00060
00061
00062
00063 virtual int make_svc_handler (ServiceHandler *&svcHnd);
00064
00065 private:
00066
00067 Acceptor() {};
00068
00069 ServiceHandler * _svcHnd;
00070 };
00071
00072 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00073 #include "acceptor.cpp"
00074 #endif
00075
00076 }
00077
00078 #endif
00079
00080
00081
00082