[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 38/50: controlport: cleanup
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 38/50: controlport: cleanup |
Date: |
Wed, 15 Apr 2015 21:07:56 +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 0d018254de818037007ead4c4c431284d58bc515
Author: Nate Goergen <address@hidden>
Date: Sun Mar 8 00:27:52 2015 -0600
controlport: cleanup
- removal of unused strings 'controlport name' and 'endpoint name'.
- Moved default_buffer_size constant from server_template, which is
where boot specific constant are currently defined.
---
.../include/gnuradio/thrift_application_base.h | 2 ++
.../include/gnuradio/thrift_server_template.h | 23 +++-------------------
.../controlport/thrift/rpcserver_booter_thrift.cc | 15 ++++++++++----
3 files changed, 16 insertions(+), 24 deletions(-)
diff --git a/gnuradio-runtime/include/gnuradio/thrift_application_base.h
b/gnuradio-runtime/include/gnuradio/thrift_application_base.h
index c950bd8..2f433dd 100644
--- a/gnuradio-runtime/include/gnuradio/thrift_application_base.h
+++ b/gnuradio-runtime/include/gnuradio/thrift_application_base.h
@@ -121,6 +121,8 @@ protected:
// Maximum number of threads to create when serving
// multiple rpc clients
static const unsigned int d_default_num_thrift_threads;
+ // Default packet size for the IP payload of thrift packets
+ static const unsigned int d_default_thrift_buffer_size;
// logger instances
gr::logger_ptr d_logger, d_debug_logger;
diff --git a/gnuradio-runtime/include/gnuradio/thrift_server_template.h
b/gnuradio-runtime/include/gnuradio/thrift_server_template.h
index ead3e56..1e9059d 100644
--- a/gnuradio-runtime/include/gnuradio/thrift_server_template.h
+++ b/gnuradio-runtime/include/gnuradio/thrift_server_template.h
@@ -39,22 +39,11 @@
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>
{
public:
- thrift_server_template(TImplClass* _this,
- const std::string& contolPortName,
- const std::string& endpointName);
+ thrift_server_template(TImplClass* _this);
~thrift_server_template();
protected:
@@ -62,10 +51,8 @@ protected:
friend class thrift_application_base<TserverBase, TImplClass>;
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.
@@ -74,7 +61,6 @@ private:
class TBufferedTransportFactory : public thrift::transport::TTransportFactory
{
public:
- TBufferedTransportFactory() : bufferSize(ALRIGHT_DEFAULT_BUFFER_SIZE) {;}
TBufferedTransportFactory(const unsigned int _bufferSize) :
bufferSize(_bufferSize) {;}
virtual ~TBufferedTransportFactory() {}
@@ -92,10 +78,7 @@ private:
template<typename TserverBase, typename TserverClass, typename TImplClass,
typename TThriftClass>
thrift_server_template<TserverBase, TserverClass, TImplClass,
TThriftClass>::thrift_server_template
-(TImplClass* _this, const std::string& controlPortName, const std::string&
endpointName)
- : thrift_application_base<TserverBase, TImplClass>(_this),
- d_contolPortName(controlPortName),
- d_endpointName(endpointName)
+(TImplClass* _this) : thrift_application_base<TserverBase, TImplClass>(_this)
{
gr::logger_ptr logger, debug_logger;
gr::configure_default_loggers(logger, debug_logger, "controlport");
@@ -115,7 +98,7 @@ thrift_server_template<TserverBase, TserverClass,
TImplClass, TThriftClass>::thr
nthreads = static_cast<unsigned
int>(gr::prefs::singleton()->get_long("thrift", "nthreads",
thrift_application_base<TserverBase,
TImplClass>::d_default_num_thrift_threads));
buffersize = static_cast<unsigned
int>(gr::prefs::singleton()->get_long("thrift", "buffersize",
- ALRIGHT_DEFAULT_BUFFER_SIZE));
+ thrift_application_base<TserverBase,
TImplClass>::d_default_thrift_buffer_size));
boost::shared_ptr<TserverClass> handler(new TserverClass());
diff --git a/gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc
b/gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc
index 2a31a4f..b6d113b 100644
--- a/gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc
+++ b/gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc
@@ -27,8 +27,12 @@
namespace {
static const char* const CONTROL_PORT_CLASS("thrift");
- static const char* const CONTROL_PORT_NAME("ControlPort");
- static const char* const ENDPOINT_NAME("gnuradio");
+ 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);
};
/*!
@@ -39,8 +43,7 @@ rpcserver_booter_thrift::rpcserver_booter_thrift() :
thrift_server_template<rpcserver_base,
rpcserver_thrift,
rpcserver_booter_thrift,
- boost::shared_ptr<GNURadio::ControlPortIf> >
- (this, std::string(CONTROL_PORT_NAME), std::string(ENDPOINT_NAME)),
+ boost::shared_ptr<GNURadio::ControlPortIf> >(this),
d_type(std::string(CONTROL_PORT_CLASS))
{;}
@@ -83,6 +86,10 @@ const unsigned int thrift_application_base<rpcserver_base,
rpcserver_booter_thri
template<class rpcserver_base, class rpcserver_booter_thrift>
const unsigned int thrift_application_base<rpcserver_base,
rpcserver_booter_thrift>::d_default_num_thrift_threads(10U);
+template<class rpcserver_base, class rpcserver_booter_thrift>
+const unsigned int thrift_application_base<rpcserver_base,
rpcserver_booter_thrift>::d_default_thrift_buffer_size(
+ ALRIGHT_DEFAULT_BUFFER_SIZE);
+
template<class rpcserver_base, class rpcserver_booter_thrift>
std::auto_ptr<thrift_application_base_impl>
thrift_application_base<rpcserver_base, rpcserver_booter_thrift>::p_impl(
- [Commit-gnuradio] [gnuradio] 39/50: controlport: documentation cleanup, (continued)
- [Commit-gnuradio] [gnuradio] 39/50: controlport: documentation cleanup, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 35/50: controlport: cleanup, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 33/50: controlport: more cleanup and conveniences, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 11/50: controlport: more work on the translation layer; properties and setting parameters in gr-ctrlport-monitor now working., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 45/50: controlport: ensure proper ctrlport shutdown., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 08/50: controlport: adding abstraction layer for the controlport backends; support thrift currently., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 25/50: controlport: fixing up some issues; generate thrift sources into thrift subdir., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 16/50: controlport: switching rpcpmtconverter::to_pmt() to To_PMT singleton, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 40/50: controlport: documentation cleanup, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 10/50: controlport: more cleanup of python code to help generalize the interface, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 38/50: controlport: cleanup,
git <=
- [Commit-gnuradio] [gnuradio] 41/50: controlport: cmake fixes to FindThrift for when thrift is not installed., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 43/50: controlport: more documentation and linking info., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 37/50: controlport: Some documentation, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 32/50: controlport: moving the generation of the Thrift endpoint string to the application_started() function., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 42/50: controlport: QA needs to get host and port out of the endpoint., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 27/50: controlport: cleaning up; trying to handle shutdown better., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 19/50: controlport: simple style editing., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 36/50: controlport: renamed some functions for clairity, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 50/50: Merge branch 'ctrlport', git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 26/50: docs: adding in info on ControlPort and Thrift., git, 2015/04/16