}
void Communicator::setRecoveryTime(const Millisecond &recoveryTime)
-throw(RuntimeException) {
+noexcept(false) {
if(recoveryTime < MinRecoveryTime || recoveryTime > MaxRecoveryTime) {
string msg("comm::Communicator::setRecoveryTime | ");
msg += functions::asString("RecoveryTime (%d ms) must be between %d ms and %d ms", recoveryTime.getValue(), MinRecoveryTime.getValue(), MaxRecoveryTime.getValue());
}
void Communicator::setTryingConnectionTime(const Millisecond &tryingConnectionTime)
-throw(RuntimeException) {
+noexcept(false) {
if(tryingConnectionTime < MinTryingConnectionTime || tryingConnectionTime > MaxTryingConnectionTime) {
string msg("comm::Communicator::setTryingConnectionTime | ");
msg += functions::asString("TryingConnectionTime (%d ms) must be between %d ms and %d ms", tryingConnectionTime.getValue(), MinTryingConnectionTime.getValue(), MaxTryingConnectionTime.getValue());
//static
void Communicator::setReceivingChunkSize(const int receivingChunkSize)
-throw(RuntimeException) {
+noexcept(false) {
if(receivingChunkSize < MinReceivingChunkSize || receivingChunkSize > MaxReceivingChunkSize) {
string msg("comm::Communicator::setReceivingChunkSize | ");
msg += functions::asString("ReceivingChunkSize (%d bytes) must be between %d bytes and %d bytes", receivingChunkSize, MinReceivingChunkSize, MaxReceivingChunkSize);
}
void Communicator::setLevelOfDenialService(const int levelOfDenialService)
-throw(RuntimeException) {
+noexcept(false) {
const int min(comm::CongestionController::MaxLevel - 2);
const int max(comm::CongestionController::MaxLevel);
}
void Communicator::attach(ServerSocket* serverSocket)
-throw(RuntimeException) {
+noexcept(false) {
if(serverSocket == NULL)
throw RuntimeException("Cannot attach a NULL comm::ServerSocket", ANNA_FILE_LOCATION);
}
void Communicator::attach(BinderSocket* binderSocket)
-throw(RuntimeException) {
+noexcept(false) {
if(binderSocket == NULL)
throw RuntimeException("Cannot attach a NULL comm::BinderSocket", ANNA_FILE_LOCATION);
* Se invoca desde comm::handler::ServerSocket::accept [Tx] -> <null>
*/
void Communicator::attach(LocalConnection* localConnection)
-throw(RuntimeException) {
+noexcept(false) {
if(localConnection == NULL)
throw RuntimeException("Cannot attach a NULL comm::LocalConnection", ANNA_FILE_LOCATION);
* los métodos Communicator::attach.
*/
void Communicator::attach(RemoteConnection* remoteConnection)
-throw(RuntimeException) {
+noexcept(false) {
if(remoteConnection == NULL)
throw RuntimeException("Cannot attach a NULL comm::RemoteConnection", ANNA_FILE_LOCATION);
}
void Communicator::attach(ClientSocket* socket)
-throw(RuntimeException) {
+noexcept(false) {
if(socket == NULL)
throw RuntimeException("Cannot attach a NULL comm::ClientSocket", ANNA_FILE_LOCATION);
}
void Communicator::attach(DatagramSocket* socket)
-throw(RuntimeException) {
+noexcept(false) {
if(socket == NULL)
throw RuntimeException("Cannot attach a NULL comm::DatagramSocket", ANNA_FILE_LOCATION);
}
void Communicator::attach(Handler* handler)
-throw(RuntimeException) {
+noexcept(false) {
if(handler == NULL)
throw RuntimeException("Cannot attach a NULL comm::Handler", ANNA_FILE_LOCATION);
}
void Communicator::attach(Service* service)
-throw(RuntimeException) {
+noexcept(false) {
if(service == NULL)
throw RuntimeException("Cannot attach a NULL comm::Service", ANNA_FILE_LOCATION);
}
void Communicator::insert(Handler* handler)
-throw(RuntimeException) {
+noexcept(false) {
handler->initialize();
if(handler->getfd() < 0) {
}
void Communicator::detach(ServerSocket* serverSocket)
-throw() {
+{
if(serverSocket == NULL)
return;
}
void Communicator::detach(ClientSocket* clientSocket)
-throw() {
+{
if(clientSocket == NULL)
return;
}
void Communicator::detach(BinderSocket* binderSocket)
-throw() {
+{
if(binderSocket == NULL)
return;
* (1) Si se cierra la conexion con el cliente que al que atencia este proceso clonado => debe terminar la ejecucion.
*/
void Communicator::detach(Handler* handler)
-throw() {
+{
if(handler == NULL)
return;
}
const Handler* Communicator::getHandler(const ClientSocket& clientSocket)
-throw(RuntimeException) {
+noexcept(false) {
Guard guard(this, "comm::Communicator::getHandler");
Handler* result = find(clientSocket.getfd());
// streams pero la forma de recorrer el bucle nos blinda (un poco) de anomalias.
//----------------------------------------------------------------------------------------------
void Communicator::accept()
-throw(RuntimeException) {
+noexcept(false) {
LOGMETHOD(TraceMethod traceMethod("comm::Communicator", "accept", ANNA_FILE_LOCATION));
if(isServing() == true)
}
void Communicator::singlethreadedAccept()
-throw(RuntimeException) {
+noexcept(false) {
LOGMETHOD(TraceMethod traceMethod(Logger::Local7, "comm::Communicator", "singlethreadedAccept", ANNA_FILE_LOCATION));
Handler* handler;
Microsecond maxTime;
}
void Communicator::multithreadedAccept()
-throw(RuntimeException) {
+noexcept(false) {
LOGMETHOD(TraceMethod traceMethod(Logger::Local7, "comm::Communicator", "multithreadedAccept", ANNA_FILE_LOCATION));
{
Guard guard(this, "comm::Communicator::multithreadedAccept");
}
void Communicator::requestStop()
-throw() {
+{
if(a_requestedStop == true)
return;
}
bool Communicator::isUsable(const ClientSocket* clientSocket)
-throw() {
+{
if(clientSocket == NULL)
return false;
}
void Communicator::setStatus(const Status& status)
-throw() {
+{
Guard guard(this, "comm::Communicator::setStatus");
if(a_status != status)
}
void Communicator::eventBreakAddress(const in_addr_t& address)
-throw() {
+{
Device* device = Network::instantiate().find(address);
if(device->getStatus() == Device::Status::Down)
}
void Communicator::eventRecoverAddress(const in_addr_t& address)
-throw() {
+{
Device* device = Network::instantiate().find(address);
if(device->getStatus() == Device::Status::Up)
}
bool Communicator::eventAcceptConnection(const ClientSocket& clientSocket)
-throw(RuntimeException) {
+noexcept(false) {
LOGMETHOD(TraceMethod traceMethod(Logger::Local7, "comm::Communicator", "eventAcceptConnection", ANNA_FILE_LOCATION));
if(a_requestedStop == true) {
// (3) Solo si todos los servicios "Criticos" estan disponibles pasara a estar "Activo".
//--------------------------------------------------------------------------------------------------------
void Communicator::eventCreateConnection(const Server* server)
-throw() {
+{
if(server == NULL)
return;
}
void Communicator::eventCreateConnection(const Service* service)
-throw() {
+{
if(service == NULL)
return;
* Se invoca desde handler::RemoteConnection:[Tx] -> Communicator
*/
void Communicator::eventBreakConnection(const Server* server)
-throw() {
+{
if(server == NULL)
return;
}
void Communicator::eventBreakConnection(const Service* service)
-throw() {
+{
if(service == NULL)
return;
}
void Communicator::eventShutdown()
-throw() {
+{
LOGWARNING(
string msg("comm::Communicator::eventShutdown | ");
msg += asString();
}
std::string Communicator::asString() const
-throw() {
+{
string result("comm::Communicator { ");
result += Component::asString();
result += " | RequestedStop: ";
}
xml::Node* Communicator::asXML(xml::Node* parent) const
-throw() {
+{
parent = app::Component::asXML(parent);
xml::Node* result = parent->createChild("comm.Communicator");
result->createAttribute("RequestedStop", anna::functions::asString(a_requestedStop));
* el proceso hijo y sigue atendiendo peticiones de conexion.
*/
void Communicator::do_cloneParent()
-throw(RuntimeException) {
+noexcept(false) {
LOGMETHOD(TraceMethod traceMethod("comm::Communicator", "do_cloneParent", ANNA_FILE_LOCATION));
Handler* handler;
Handler::Type::_v type;
* con ese handler => el programa terminara la ejecucion.
*/
void Communicator::do_cloneChild()
-throw() {
+{
LOGMETHOD(TraceMethod traceMethod("comm::Communicator", "do_cloneChild", ANNA_FILE_LOCATION));
LOGINFORMATION(
string msg("comm::Communicator::do_cloneChild | MainHandler: ");
}
int Communicator::SortByFileDescriptor::value(const Handler* handler)
-throw() {
+{
return handler->getfd();
}