X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FProtocols%2FGenericAddressingPolicy.cti;h=6cba6c2a9c9aa2dcdb10172ee14717c6598d7890;hb=3cb0a2ff50b8f1111da34b696e64fb1b037cd683;hp=68f31cdc3e2f75d05e719f3b9ea0b96265569b0f;hpb=2c4c9deecc7491fbfc916aeb41074dcb76e8a2c2;p=senf.git diff --git a/Socket/Protocols/GenericAddressingPolicy.cti b/Socket/Protocols/GenericAddressingPolicy.cti index 68f31cd..6cba6c2 100644 --- a/Socket/Protocols/GenericAddressingPolicy.cti +++ b/Socket/Protocols/GenericAddressingPolicy.cti @@ -1,9 +1,9 @@ // $Id$ // // Copyright (C) 2006 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -36,52 +36,73 @@ #ifndef DOXYGEN template -template +template prefix_ void senf::GenericAddressingPolicy
:: -peer(SocketHandle handle, Address & addr, - typename IfCommunicationPolicyIs::type *) +peer(SocketHandle handle, Address & addr, + typename IfCommunicationPolicyIs::type *) { addr.clear(); - do_peer(handle,addr.sockaddr_p(),addr.sockaddr_len()); + try { + do_peer(handle,addr.sockaddr_p(),addr.sockaddr_len()); + } catch (Exception & e) { + e << "; could not get peer for address \"" << addr << "\""; + throw; + } } #else template -template +template prefix_ void senf::GenericAddressingPolicy
:: -peer(SocketHandle handle, Address & addr) +peer(SocketHandle handle, Address & addr) {} #endif #ifndef DOXYGEN template -template +template prefix_ void senf::GenericAddressingPolicy
:: -connect(SocketHandle handle, Address const & addr, - typename IfCommunicationPolicyIs::type *) +connect(SocketHandle handle, Address const & addr, + typename IfCommunicationPolicyIs::type *) { - do_connect(handle,addr.sockaddr_p(),addr.sockaddr_len()); + try { + do_connect(handle,addr.sockaddr_p(),addr.sockaddr_len()); + } catch (Exception & e) { + e << "; could not connect to address \"" << addr << "\""; + throw; + } } #else template -template +template prefix_ void senf::GenericAddressingPolicy
:: -connect(SocketHandle handle, Address const & addr) +connect(SocketHandle handle, Address const & addr) {} #endif template prefix_ void senf::GenericAddressingPolicy
::local(FileHandle handle, - Address & addr) + Address & addr) { addr.clear(); - do_local(handle,addr.sockaddr_p(),addr.sockaddr_len()); + try { + do_local(handle,addr.sockaddr_p(),addr.sockaddr_len()); + } catch (Exception & e) { + // TODO: identify socket by some meaningful attribute + e << "; could not get name for address \"" << addr << "\""; + throw; + } } template prefix_ void senf::GenericAddressingPolicy
::bind(FileHandle handle, Address const & addr) { - do_bind(handle,addr.sockaddr_p(),addr.sockaddr_len()); + try { + do_bind(handle,addr.sockaddr_p(),addr.sockaddr_len()); + } catch (Exception & e) { + e << "; could not bind to address \"" << addr << "\""; + throw; + } } ///////////////////////////////cti.e/////////////////////////////////////// @@ -94,6 +115,6 @@ prefix_ void senf::GenericAddressingPolicy
::bind(FileHandle handle, // c-file-style: "senf" // indent-tabs-mode: nil // ispell-local-dictionary: "american" -// compile-command: "scons -u test" +// compile-command: "scons -u ../test" // comment-column: 40 // End: