X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FProtocols%2FGenericAddressingPolicy.cti;h=6cba6c2a9c9aa2dcdb10172ee14717c6598d7890;hb=22e56fa8ef4cea3fd55c9463ecd2af8a6fbd213d;hp=94b3e05e87401cc69ea9d7ca6e10943671ef2f25;hpb=f73fa16ed5abdce272ac77f8b8b9ef2b9922c266;p=senf.git diff --git a/Socket/Protocols/GenericAddressingPolicy.cti b/Socket/Protocols/GenericAddressingPolicy.cti index 94b3e05..6cba6c2 100644 --- a/Socket/Protocols/GenericAddressingPolicy.cti +++ b/Socket/Protocols/GenericAddressingPolicy.cti @@ -1,8 +1,8 @@ // $Id$ // // Copyright (C) 2006 -// Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY +// 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 @@ -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: