73c4213f58453f1fde6112b887539843189f9c63
[anna.git] / include / anna / diameter.comm / ServerSessionReceiver.hpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite                           //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7
8
9 #ifndef anna_diameter_comm_ServerSessionReceiver_hpp
10 #define anna_diameter_comm_ServerSessionReceiver_hpp
11
12 #include <anna/comm/Receiver.hpp>
13 #include <anna/core/RuntimeException.hpp>
14
15
16 namespace anna {
17 namespace comm {
18 class Message;
19 class ClientSocket;
20 //class Server;
21 }
22 }
23
24
25 namespace anna {
26
27 namespace diameter {
28
29 namespace comm {
30
31
32 class ServerSession;
33
34
35 class ServerSessionReceiver : public anna::comm::Receiver {
36 public:
37   static const char* className() throw() { return "diameter.comm.ServerSessionReceiver"; }
38   void setReference(ServerSession *s) throw() { a_session = s; }
39
40   // base class virtuals
41   void eventBreakLocalConnection(const anna::comm::ClientSocket&cli) throw();
42   //void eventCreateConnection(const anna::comm::Server*srv) throw();
43
44 private:
45   ServerSessionReceiver() : anna::comm::Receiver("diameter.comm.ServerSessionReceiver") { a_session = NULL; }
46   void initialize() throw(anna::RuntimeException) {;}
47   void apply(anna::comm::ClientSocket&, const anna::comm::Message&) throw(anna::RuntimeException);
48
49
50   anna::diameter::comm::ServerSession *a_session;
51
52   friend class anna::Allocator <ServerSessionReceiver>;
53 };
54
55
56 }
57 }
58 }
59
60 #endif
61