X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;ds=sidebyside;f=source%2Fcomm%2FSocket.cpp;h=365f4278ba750a08e71398fe3b0916dd4642258c;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hp=9a7db2b6df534d456ca159e67aaebbb003cee15d;hpb=93366a0bda79e6fd6e7dad6316bfcf8cc82f5731;p=anna.git diff --git a/source/comm/Socket.cpp b/source/comm/Socket.cpp index 9a7db2b..365f427 100644 --- a/source/comm/Socket.cpp +++ b/source/comm/Socket.cpp @@ -97,7 +97,7 @@ Socket::~Socket() { } bool Socket::support(const char* transportClassName) const -throw() { +{ if(a_transportFactory == NULL) return false; @@ -109,7 +109,7 @@ throw() { // ya tienen activa su propia zona de exclusin. //--------------------------------------------------------------------------- void Socket::open() -throw(RuntimeException) { +noexcept(false) { if(a_fd != -1) return; @@ -144,7 +144,7 @@ throw(RuntimeException) { } void Socket::close() -throw() { +{ if(a_fd == -1) return; @@ -164,7 +164,7 @@ throw() { } bool Socket::setBlockingMode(const bool blockingMode) -throw(RuntimeException) { +noexcept(false) { int opts; int result; anna_socket_assert(a_fd == -1, "Socket is not opened"); @@ -187,7 +187,7 @@ throw(RuntimeException) { } bool Socket::setReuseMode(const bool reuseMode) -throw(RuntimeException) { +noexcept(false) { anna_socket_assert(a_fd == -1, "Socket is not opened"); if(a_reuseMode == reuseMode) @@ -204,7 +204,7 @@ throw(RuntimeException) { } void Socket::bind() -throw(RuntimeException) { +noexcept(false) { Guard guard(*this, "comm::Socket::bind"); if(a_fd == -1) @@ -231,17 +231,14 @@ throw(RuntimeException) { } int Socket::do_bind(const struct sockaddr *addr, const int len) -throw(RuntimeException) { +noexcept(false) { return ::bind(a_fd, addr, len); } std::string Socket::asString() const -throw() { +{ std::string msg("comm::Socket { Domain: "); - if(this == NULL) - return msg += " }"; - switch(a_domain) { case Domain::Unix: msg += "Unix"; break; case Domain::Inet: msg += "Inet"; break; @@ -278,7 +275,7 @@ throw() { } xml::Node* Socket::asXML(xml::Node* parent) const -throw(RuntimeException) { +noexcept(false) { const char* aux; xml::Node* result = parent->createChild("comm.Socket"); @@ -316,7 +313,7 @@ throw(RuntimeException) { } const char* Socket::asText(const Socket::Notify::_v v) -throw() { +{ static const char* text [] = { "None", "ReceiveData", "Close", "Corrupt" }; return text [v]; }