Remove dynamic exceptions
[anna.git] / include / anna / diameter.comm / ServerSocket.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_ServerSocket_hpp
10 #define anna_diameter_comm_ServerSocket_hpp
11
12
13 #include <anna/comm/ServerSocket.hpp>
14 #include <anna/core/RuntimeException.hpp>
15
16 // STL
17 #include <string>
18
19 #include <anna/config/defines.hpp>
20
21
22 namespace anna {
23 namespace xml {
24 class Node;
25 }
26 namespace comm {
27 class INetAddress;
28 class ClientSocket;
29 }
30 }
31
32 namespace anna {
33
34 namespace diameter {
35
36 namespace comm {
37
38
39 class LocalServer;
40
41 /**
42    Diameter server socket
43 */
44 class ServerSocket : public anna::comm::ServerSocket {
45
46   LocalServer * a_localServer;
47
48   virtual bool eventAcceptConnection(const anna::comm::ClientSocket &clientSocket) noexcept(false);
49
50
51 public:
52
53   /**
54      Constructor
55
56      @param localAddress Listen address
57      @param localServer Local access point
58      @param engine Diameter comm engine
59   */
60   ServerSocket(const anna::comm::INetAddress &localAddress, LocalServer *localServer);
61
62
63   /** Destructor */
64   // ~ServerSocket() { detach(); } // detaching avoids bad file descriptor at poll when application destroy diameter ServerSockets
65
66
67   //friend class LocalServer;
68 };
69
70 }
71 }
72 }
73
74 #endif
75