[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 18/50: controlport: improving transport lay
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 18/50: controlport: improving transport layer throughput. |
Date: |
Wed, 15 Apr 2015 21:07:53 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 7a8989d21de2f9a121eafe56ce0b557572a498d4
Author: Nate Goergen <address@hidden>
Date: Sun Mar 1 20:03:35 2015 -0600
controlport: improving transport layer throughput.
* made a new TbufferedTransportFactory class to create transports with
buffer sizes different (i.e. greater) than the Thrift default of 512 bytes.
* note: this should eventually be user configurable as a ControlPort
setting in the GNU Radio config file
** hard-coding a value for now for an assumed Ethernet MTU of 1500 bytes..
Not ideal, but better than the Thrift default.
---
.../include/gnuradio/thrift_server_template.h | 34 +++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/gnuradio-runtime/include/gnuradio/thrift_server_template.h
b/gnuradio-runtime/include/gnuradio/thrift_server_template.h
index 3147696..5de0112 100644
--- a/gnuradio-runtime/include/gnuradio/thrift_server_template.h
+++ b/gnuradio-runtime/include/gnuradio/thrift_server_template.h
@@ -37,6 +37,15 @@
using namespace apache;
+namespace {
+ static const unsigned int ETHERNET_HEADER_SIZE(14);
+ static const unsigned int IP_HEADER_SIZE(20);
+ static const unsigned int TCP_HEADER_SIZE(32);
+ static const unsigned int ETHERNET_TYPICAL_MTU(1500);
+ static const unsigned int ALRIGHT_DEFAULT_BUFFER_SIZE(
+ ETHERNET_TYPICAL_MTU - ETHERNET_HEADER_SIZE - IP_HEADER_SIZE -
TCP_HEADER_SIZE);
+}
+
template<typename TserverBase, typename TserverClass, typename TImplClass,
typename TThriftClass>
class thrift_server_template : public thrift_application_base<TserverBase,
TImplClass>
{
@@ -52,6 +61,29 @@ protected:
TserverBase* d_server;
const std::string d_contolPortName, d_endpointName;
+
+private:
+
+ /**
+ * Custom TransportFactory that allows you to override the default Thrift
buffer size
+ * of 512 bytes.
+ *
+ */
+ class TBufferedTransportFactory : public
thrift::transport::TTransportFactory {
+ public:
+ TBufferedTransportFactory() : bufferSize(ALRIGHT_DEFAULT_BUFFER_SIZE) {;}
+ TBufferedTransportFactory(const unsigned int _bufferSize) :
bufferSize(_bufferSize) {;}
+
+ virtual ~TBufferedTransportFactory() {}
+
+ virtual boost::shared_ptr<thrift::transport::TTransport> getTransport(
+ boost::shared_ptr<thrift::transport::TTransport> trans) {
+ return boost::shared_ptr<thrift::transport::TTransport>(
+ new thrift::transport::TBufferedTransport(trans, bufferSize));
+ }
+ private:
+ unsigned int bufferSize;
+ };
};
template<typename TserverBase, typename TserverClass, typename TImplClass,
typename TThriftClass>
@@ -72,7 +104,7 @@ thrift_server_template<TserverBase, TserverClass,
TImplClass, TThriftClass>::thr
serverTransport(new thrift::transport::TServerSocket(9090));
boost::shared_ptr<thrift::transport::TTransportFactory>
- transportFactory(new thrift::transport::TBufferedTransportFactory());
+ transportFactory(new thrift_server_template::TBufferedTransportFactory());
boost::shared_ptr<thrift::protocol::TProtocolFactory>
protocolFactory(new thrift::protocol::TBinaryProtocolFactory());
- [Commit-gnuradio] [gnuradio] branch master updated (676d5cb -> b092142), git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 03/50: controlport: working controlport server using thrift., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 06/50: controlport: quick fix, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 02/50: ctrlport: thrift: "py" instead of "python" -- guessing a version thing, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 04/50: controlport: restructuring to add subdirs for different cp backends., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 18/50: controlport: improving transport layer throughput.,
git <=
- [Commit-gnuradio] [gnuradio] 07/50: controlport: Addes a FindThrift cmake module to find the Thrift headers, libraries, and Python files., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 17/50: controlport: convert to To_PMT registration objects, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 20/50: runtime: more generic version of prefs class., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 22/50: cmake: force QA tests to turn ControlPort off by default., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 15/50: controlport: convert rpcpmtconverter::to_pmt() if statement to a function object map, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 01/50: Initial thrift definition for gnuradio, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 14/50: controlport: Thrift's binary type, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 09/50: controlport: cleanup and switching over to new Python common interface., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 23/50: controlport: cleaning up and using logger to display endpoint., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 34/50: controlport: replacement of nanosleep() with boost::sleep() in startup thread. Fix of merge error in booter_thrift., git, 2015/04/16