2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
15 \brief SocketSink non-inline template implementation */
17 //#include "SocketSink.ih"
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 // senf::ppi::module::ActiveSocketSink<Writer>
27 template <class Writer>
28 prefix_ senf::ppi::module::ActiveSocketSink<Writer>::ActiveSocketSink()
30 registerEvent( event_, &ActiveSocketSink::write );
34 template <class Writer>
35 prefix_ senf::ppi::module::ActiveSocketSink<Writer>::ActiveSocketSink(Writer const & writer)
38 registerEvent( event_, &ActiveSocketSink::write );
42 template <class Writer>
43 prefix_ senf::ppi::module::ActiveSocketSink<Writer>::ActiveSocketSink(Handle const & handle)
44 : handle_(handle), event_(handle_, IOEvent::Write), writer_()
46 registerEvent( event_, &ActiveSocketSink::write );
50 template <class Writer>
51 prefix_ senf::ppi::module::ActiveSocketSink<Writer>::ActiveSocketSink(Handle const & handle,
52 Writer const & writer)
53 : handle_(handle), event_(handle_, IOEvent::Write), writer_(writer)
55 registerEvent( event_, &ActiveSocketSink::write );
59 //-/////////////////////////////////////////////////////////////////////////////////////////////////
62 template <class Writer>
63 prefix_ void senf::ppi::module::ActiveSocketSink<Writer>::write()
65 writer_(handle_,input());
68 //-/////////////////////////////////////////////////////////////////////////////////////////////////
69 // senf::ppi::module::PassiveSocketSink<Writer>
71 template <class Writer>
72 prefix_ senf::ppi::module::PassiveSocketSink<Writer>::PassiveSocketSink()
75 input.onRequest(&PassiveSocketSink::write);
79 template <class Writer>
80 prefix_ senf::ppi::module::PassiveSocketSink<Writer>::PassiveSocketSink(Writer const & writer)
84 input.onRequest(&PassiveSocketSink::write);
88 template <class Writer>
89 prefix_ senf::ppi::module::PassiveSocketSink<Writer>::PassiveSocketSink(Handle const & handle)
90 : handle_(handle), writer_()
93 input.onRequest(&PassiveSocketSink::write);
97 template <class Writer>
98 prefix_ senf::ppi::module::PassiveSocketSink<Writer>::PassiveSocketSink(Handle const & handle,
99 Writer const & writer)
100 : handle_(handle), writer_(writer)
103 input.onRequest(&PassiveSocketSink::write);
107 //-/////////////////////////////////////////////////////////////////////////////////////////////////
110 template <class Writer>
111 prefix_ void senf::ppi::module::PassiveSocketSink<Writer>::write()
113 if (writer_(handle_,input()))
119 template <class Writer>
120 prefix_ void senf::ppi::module::PassiveSocketSink<Writer>::checkThrottle()
128 //-/////////////////////////////////////////////////////////////////////////////////////////////////
135 // comment-column: 40
136 // c-file-style: "senf"
137 // indent-tabs-mode: nil
138 // ispell-local-dictionary: "american"
139 // compile-command: "scons -u test"