-class ZAssocServerChild : public yazpp_1::Z_Assoc {
-public:
- ~ZAssocServerChild();
- ZAssocServerChild(yazpp_1::IPDU_Observable *the_PDU_Observable,
- yp2::ThreadPoolSocketObserver *m_thread_pool_observer,
- const yp2::Package *package);
- int m_no_requests;
-private:
- yazpp_1::IPDU_Observer* sessionNotify(
- yazpp_1::IPDU_Observable *the_PDU_Observable,
- int fd);
- void recv_GDU(Z_GDU *apdu, int len);
-
- void failNotify();
- void timeoutNotify();
- void connectNotify();
-private:
- yp2::ThreadPoolSocketObserver *m_thread_pool_observer;
- yp2::Session m_session;
- yp2::Origin m_origin;
- bool m_delete_flag;
- const yp2::Package *m_package;
-};
-
-
-class ThreadPoolPackage : public yp2::IThreadPoolMsg {
-public:
- ThreadPoolPackage(yp2::Package *package, ZAssocServerChild *ses) :
- m_session(ses), m_package(package) { };
- ~ThreadPoolPackage();
- IThreadPoolMsg *handle();
- void result();
-
-private:
- ZAssocServerChild *m_session;
- yp2::Package *m_package;
-
-};
+namespace mp = metaproxy_1;
+namespace yf = metaproxy_1::filter;
+
+namespace metaproxy_1 {
+ namespace filter {
+ class FrontendNet::Port {
+ friend class Rep;
+ friend class FrontendNet;
+ std::string port;
+ std::string route;
+ };
+ class FrontendNet::Rep {
+ friend class FrontendNet;
+
+ int m_no_threads;
+ std::vector<Port> m_ports;
+ int m_listen_duration;
+ int m_session_timeout;
+ int m_connect_max;
+ std::string m_msg_config;
+ std::string m_stat_req;
+ yazpp_1::SocketManager mySocketManager;
+ ZAssocServer **az;
+ int m_duration_freq[22];
+ double m_duration_lim[22];
+ public:
+ Rep();
+ ~Rep();
+ };
+ class FrontendNet::My_Timer_Thread : public yazpp_1::ISocketObserver {
+ private:
+ yazpp_1::ISocketObservable *m_obs;
+ Pipe m_pipe;
+ bool m_timeout;
+ public:
+ My_Timer_Thread(yazpp_1::ISocketObservable *obs, int duration);
+ void socketNotify(int event);
+ bool timeout();
+ };
+ class FrontendNet::ZAssocChild : public yazpp_1::Z_Assoc {
+ public:
+ ~ZAssocChild();
+ ZAssocChild(yazpp_1::IPDU_Observable *the_PDU_Observable,
+ mp::ThreadPoolSocketObserver *m_thread_pool_observer,
+ const mp::Package *package,
+ std::string route,
+ Rep *rep);
+ int m_no_requests;
+ std::string m_route;
+ private:
+ yazpp_1::IPDU_Observer* sessionNotify(
+ yazpp_1::IPDU_Observable *the_PDU_Observable,
+ int fd);
+ void recv_GDU(Z_GDU *apdu, int len);
+
+ void failNotify();
+ void timeoutNotify();
+ void connectNotify();
+ private:
+ mp::ThreadPoolSocketObserver *m_thread_pool_observer;
+ mp::Session m_session;
+ mp::Origin m_origin;
+ bool m_delete_flag;
+ const mp::Package *m_package;
+ Rep *m_p;
+ };
+ class FrontendNet::ThreadPoolPackage : public mp::IThreadPoolMsg {
+ public:
+ ThreadPoolPackage(mp::Package *package,
+ yf::FrontendNet::ZAssocChild *ses,
+ Rep *rep);
+ ~ThreadPoolPackage();
+ IThreadPoolMsg *handle();
+ void result(const char *t_info);
+ bool cleanup(void *info);
+ private:
+ yaz_timing_t timer;
+ ZAssocChild *m_assoc_child;
+ mp::Package *m_package;
+ Rep *m_p;
+ };
+ class FrontendNet::ZAssocServer : public yazpp_1::Z_Assoc {
+ public:
+ ~ZAssocServer();
+ ZAssocServer(yazpp_1::IPDU_Observable *PDU_Observable,
+ std::string route,
+ Rep *rep);
+ void set_package(const mp::Package *package);
+ void set_thread_pool(ThreadPoolSocketObserver *observer);
+ private:
+ yazpp_1::IPDU_Observer* sessionNotify(
+ yazpp_1::IPDU_Observable *the_PDU_Observable,
+ int fd);
+ void recv_GDU(Z_GDU *apdu, int len);
+
+ void failNotify();
+ void timeoutNotify();
+ void connectNotify();
+ private:
+ mp::ThreadPoolSocketObserver *m_thread_pool_observer;
+ const mp::Package *m_package;
+ yazpp_1::LimitConnect limit_connect;
+ std::string m_route;
+ Rep *m_p;
+ };
+ }
+}
+
+yf::FrontendNet::ThreadPoolPackage::ThreadPoolPackage(mp::Package *package,
+ ZAssocChild *ses,
+ Rep *rep) :
+ m_assoc_child(ses), m_package(package), m_p(rep)
+{
+ timer = yaz_timing_create();
+}