diff --git a/PPI/SocketSink.cci b/PPI/SocketSink.cci index 5acdcac1d18cd011cacf541548626457ad23e4ea..08cc5692deaf2c8dba23d9ebada2e0b730a7ce28 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 0c24c9f02c34b530326eb6e99c890d3ac04544bb..24b33dd8afe657ecf32a8ec3bf20629376b9951e 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 96e3360435bbbbfd7b7bc16d01ebead0c167152a..5e63b99d45100f418f45dadb31c3d57900336567 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