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 QueueSocketSourceSink inline template implementation */
17 #include "QueueSocketSourceSink.ih"
20 #include <senf/Utils/membind.hh>
21 #include <senf/Packets/PacketInfo.hh>
22 #include "SocketSource.hh"
24 #define prefix_ inline
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
27 //-/////////////////////////////////////////////////////////////////////////////////////////////////
28 // senf::ppi::module::ActiveQueueSocketSource<Packet>
30 template <class Packet, class Connector>
31 prefix_ unsigned senf::ppi::module::ActiveQueueSocketSource<Packet,Connector>::maxBurst()
37 template <class Packet, class Connector>
38 prefix_ void senf::ppi::module::ActiveQueueSocketSource<Packet,Connector>::maxBurst(unsigned burst)
40 maxBurst_ = std::max(burst, 1u);
43 template <class Packet, class Connector>
44 prefix_ void senf::ppi::module::ActiveQueueSocketSource<Packet,Connector>::flush()
46 if (burst_ == 0) { // not in read() loop
48 while (handle_.dequeue());
56 //-/////////////////////////////////////////////////////////////////////////////////////////////////
57 // senf::ppi::module::PassiveQueueSocketSink
59 template <class Connector>
60 prefix_ void senf::ppi::module::PassiveQueueSocketSink<Connector>::flush()
62 QueueWritePolicy::flush(handle_);
64 writeEvent_.enabled(false);
67 //-/////////////////////////////////////////////////////////////////////////////////////////////////
75 // c-file-style: "senf"
76 // indent-tabs-mode: nil
77 // ispell-local-dictionary: "american"
78 // compile-command: "scons -u test"