ANNA Suite
2020b
Multipurpose development suite for Telco applications
|
#include <Server.hpp>
Public Member Functions | |
Server (int maxClientSessions=1) | |
virtual | ~Server () |
void | addClientSession (int socketId) noexcept(false) |
void | setClassCodeTimeout (const ClassCode::_v v, const anna::Millisecond &millisecond) |
bool | bind () noexcept(false) |
void | raiseAutoRecovery (bool autoRecovery=true) noexcept(false) |
bool | send (const Message *, int socketId=-1) noexcept(false) |
bool | send (const Message &message, int socketId=-1) noexcept(false) |
ClientSession * | getLastUsedResource () const |
bool | broadcast (const Message *) noexcept(false) |
bool | broadcast (const Message &message) noexcept(false) |
void | close () noexcept(false) |
const Entity * | getParent () const |
bool | isAvailable () const |
std::vector< ClientSession * >::iterator | begin () |
std::vector< ClientSession * >::iterator | end () |
std::vector< ClientSession * >::const_iterator | begin () const |
std::vector< ClientSession * >::const_iterator | end () const |
int | getNumberOfClientSessions () const |
int | getMaxClientSessions () const |
void | setMaxClientSessions (int maxClientSessions) |
const std::string & | getAddress () const |
int | getPort () const |
std::string | socketAsString () const |
const anna::Millisecond & | getLastIncomingActivityTime () const |
const anna::Millisecond & | getLastOutgoingActivityTime () const |
int | getOTARequests () const |
bool | idle () const |
void | hide () |
void | show () |
bool | hidden () const |
bool | shown () const |
std::string | asString () const |
anna::xml::Node * | asXML (anna::xml::Node *parent) const |
void | updateProcessingTimeStatisticConcept (const double &value, const anna::diameter::CommandId &cid) |
void | updateReceivedMessageSizeStatisticConcept (const double &value, const anna::diameter::CommandId &cid) |
Protected Member Functions | |
virtual void | eventPeerShutdown (const ClientSession *) |
virtual void | eventRequestRetransmission (const ClientSession *, Message *request) |
virtual void | eventResponse (const Response &response, const anna::diameter::comm::OriginHost *myNode) noexcept(false) |
virtual void | eventRequest (ClientSession *clientSession, const anna::DataBlock &request, const anna::diameter::comm::OriginHost *myNode) noexcept(false) |
virtual void | eventUnknownResponse (ClientSession *clientSession, const anna::DataBlock &response, const anna::diameter::comm::OriginHost *myNode) noexcept(false) |
virtual void | eventDPA (ClientSession *clientSession, const anna::DataBlock &response, const anna::diameter::comm::OriginHost *myNode) noexcept(false) |
Friends | |
class | Engine |
class | ClientSession |
Diameter server with 1..N connections.
|
inline |
|
noexcept |
Add a server to the entity and create all the client-sessions configured at #setSocketsPerDiameterServer within that server.
socketId | Diameter socket identifier within the server. |
std::string anna::diameter::comm::Server::asString | ( | ) | const |
Class string representation
anna::xml::Node* anna::diameter::comm::Server::asXML | ( | anna::xml::Node * | parent | ) | const |
Class xml representation
parent | Parent XML node on which hold this instance information. |
|
inline |
|
inline |
|
noexcept |
Binds server client-sessions.
|
noexcept |
Sent a message to all the server client-sessions (socketId's) for multiple client client-sessions functionality. It is used, i.e., in Disconnect-Peer-Request procedure over a certain server. Returns true (success) only when broadcast is success over all the server client-sessions. If any client-session fails, then false is returned. Broadcast try to send all over the resources in spite of any fail.
|
inlinenoexcept |
|
inlinenoexcept |
Close all the server client-sessions. Depending on client-session configuration ('OnDisconnect' behaviour), pending answers will be wait (graceful) or ignored (immediate-abrupt close). Resources are not destroyed.
|
inline |
|
inline |
|
protectedvirtualnoexcept |
Handler for diameter server (client-session) Disconnect-Peer-Answer messages
clientSession | ClientSession from which request has been received |
response | Answer data block object without context match |
|
protectedvirtual |
Handler about event break connection from diameter server (client-session) over this entity.
When notified, ANNA.diameter.comm generates an diameter::comm::Entity::eventResponse for every request with pending answers.
|
protectedvirtualnoexcept |
Handler for diameter server (client-session) requests
clientSession | ClientSession from which request has been received |
request | Diameter request message received |
|
protectedvirtual |
Handler about a request retransmission over the session.
request | Message retransmitted |
|
protectedvirtualnoexcept |
Handler for diameter server (client-session) responses
response | Answer container object for corresponding diameter request |
|
protectedvirtualnoexcept |
Handler for diameter server (client-session) responses out of context
clientSession | ClientSession from which request has been received |
response | Answer data block object without context match |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
int anna::diameter::comm::Server::getOTARequests | ( | ) | const |
Gets the number of requests messages over-the-air.
|
inline |
|
inline |
bool anna::diameter::comm::Server::hidden | ( | ) | const |
Returns true when all its client session resources are hidden for application messages delivery
void anna::diameter::comm::Server::hide | ( | ) |
Deny resources for delivery restriction. Deny all its client sessions
|
inline |
Returns idle state (no pending answers).
|
inline |
|
noexcept |
Propagate auto recovery configuration to client-sessions within server
autoRecovery | Auto recovery indicator. True by default. |
|
noexcept |
|
inlinenoexcept |
void anna::diameter::comm::Server::setClassCodeTimeout | ( | const ClassCode::_v | v, |
const anna::Millisecond & | millisecond | ||
) |
Set timeout to consider failed a request.
v | Requests class code. |
millisecond | Milliseconds wait before considering the requests failed. |
Timers are internally managed and automatically activated.
|
inline |
void anna::diameter::comm::Server::show | ( | ) |
Allow resource for delivery permission. Allow all its client sessions
bool anna::diameter::comm::Server::shown | ( | ) | const |
Returns true when all its client session resources are shown for application messages delivery
std::string anna::diameter::comm::Server::socketAsString | ( | ) | const |
Server presentation as 'ADDRESS:PORT'
void anna::diameter::comm::Server::updateProcessingTimeStatisticConcept | ( | const double & | value, |
const anna::diameter::CommandId & | cid | ||
) |
void anna::diameter::comm::Server::updateReceivedMessageSizeStatisticConcept | ( | const double & | value, |
const anna::diameter::CommandId & | cid | ||
) |
|
friend |
|
friend |