From 6b757f16fdcb8ddee9694521db1974d42cb4c5af Mon Sep 17 00:00:00 2001 From: g0dil <g0dil@wiback.org> Date: Thu, 31 Jan 2008 08:34:19 +0000 Subject: [PATCH] Merged revisions 623,625-627,630-652 via svnmerge from https://svn.berlios.de/svnroot/repos/senf/branches/2008-01-TW ........ r647 | dw6 | 2008-01-30 15:53:54 +0100 (Wed, 30 Jan 2008) | 1 line adding access to handle to reconnect sockets ........ r649 | dw6 | 2008-01-30 17:30:03 +0100 (Wed, 30 Jan 2008) | 1 line moving template implementation into cti ........ --- PPI/SocketSink.cci | 10 +--------- PPI/SocketSink.cti | 11 +++++++++++ PPI/SocketSink.hh | 5 +++++ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/PPI/SocketSink.cci b/PPI/SocketSink.cci index 5acdcac1d..08cc5692d 100644 --- a/PPI/SocketSink.cci +++ b/PPI/SocketSink.cci @@ -25,6 +25,7 @@ // Custom includes #include "SocketSink.hh" +#include "../Socket/ClientSocketHandle.hh" #define prefix_ inline ///////////////////////////////cci.p/////////////////////////////////////// @@ -37,15 +38,6 @@ prefix_ void senf::ppi::ConnectedDgramWriter::operator()(Handle handle, Packet p handle.write(packet.data()); } -/////////////////////////////////////////////////////////////////////////// -// senf::ppi::module::PassiveSocketSink<Writer> - -template <class Writer> -prefix_ void senf::ppi::module::PassiveSocketSink<Writer>::replaceHandle(Handle handle) -{ - handle_ = handle; -} - ///////////////////////////////cci.e/////////////////////////////////////// #undef prefix_ diff --git a/PPI/SocketSink.cti b/PPI/SocketSink.cti index 0c24c9f02..24b33dd8a 100644 --- a/PPI/SocketSink.cti +++ b/PPI/SocketSink.cti @@ -48,6 +48,17 @@ prefix_ Writer & senf::ppi::module::PassiveSocketSink<Writer>::writer() return writer_; } +template <class Writer> +prefix_ typename Writer::Handle & senf::ppi::module::PassiveSocketSink<Writer>::handle() +{ + return handle_; +} + +template <class Writer> +prefix_ void senf::ppi::module::PassiveSocketSink<Writer>::replaceHandle(Handle handle) +{ + handle_ = handle; +} ///////////////////////////////cti.e/////////////////////////////////////// #undef prefix_ diff --git a/PPI/SocketSink.hh b/PPI/SocketSink.hh index 96e336043..5e63b99d4 100644 --- a/PPI/SocketSink.hh +++ b/PPI/SocketSink.hh @@ -179,6 +179,11 @@ namespace module { \param[in] handle Handle to write data to */ Writer & writer(); ///< Access the Writer + Handle & handle(); /**< Access the handle. This is intendet to be mainly used to reconnect the under + lying socket. */ + /* void reconnect(senf::SocketAddress newAddress); + ///< Reconnect the handle to which the packets are written + */ void replaceHandle(Handle newHandle); /**< Replace the handle to which the packets are written * Normally you should access the handle and call connect with -- GitLab